none
Select a range of cells using ActiveCell RRS feed

  • Question

  • I am trying to select a range of cells using ActiveCell.Offset

    This is really testing me, up to now I have this:-

    Private Sub CommandButton1_Click()


        Windows("example.xls").Activate
        With Worksheets("Data").Range("C1:C65536")
        Set c = .Find("", LookIn:=xlValues)
        If Not c Is Nothing Then
        firstAddress = c.Address
        Do
        c.Select
        Loop While Not c Is Nothing And c.Address <> firstAddress
        End If
        End With
        Start_Point = ActiveCell.Address
        ActiveCell.Select
        ActiveCell.Offset(rowOffset:=-50, columnOffset:=0).Activate
        ActiveCell.Select

    End Sub

    I want to select the last 50 cells in column C

    Please help!

    Thanks.

    Wednesday, March 18, 2015 5:16 PM

Answers

  • Windows("example.xls").Activate
        Worksheets("Data").Select
       
        With Worksheets("Data").Range("C1:C65536")
        Set c = .Find("", LookIn:=xlValues)
        If Not c Is Nothing Then
        firstAddress = c.Address
        Do
        c.Select
        Loop While Not c Is Nothing And c.Address <> firstAddress
        End If
        End With
        Start_Point = ActiveCell.Address
        ActiveCell.Select
        ActiveCell.Offset(rowOffset:=-50, columnOffset:=0).Activate
        ActiveCell.Select
        ActiveCell.Offset(0).Resize(50).Select
       
        Selection.Copy
    • Marked as answer by Major_Parts Wednesday, March 18, 2015 8:19 PM
    Wednesday, March 18, 2015 8:19 PM