Consulting

Results 1 to 2 of 2

Thread: select A2 through the last used cell in a column

  1. #1
    VBAX Regular
    Joined
    Oct 2004
    Posts
    65
    Location

    select A2 through the last used cell in a column

    Hi I am trying to have a code select all the used cells in a specific columns the data may have data missing in some rows but then continues and the amount of rows is dynamic (can change)

    I used the macro recorder and it gave me this the issue is that the column may have blank rows in then the data continues

    [VBA]Sheets("RAW").Select
    Range("E2").Select
    Range(Selection, Selection.End(xlDown)).Select[/VBA]

    I found this code but it copying everything from P2 on etc

    [VBA]With ActiveSheet
    .Range("P2", .Cells.SpecialCells(xlCellTypeLastCell)).Select
    End With[/VBA]

    any help would be apricated
    We are living in a world today
    where lemonade is made from
    artificial flavoring and furniture polish
    is made from real lemons...
    Alfred E Newman

  2. #2
    VBAX Contributor
    Joined
    Feb 2009
    Posts
    103
    Location
    hi mduff, don't know if this is what you mean.. please check below.

    [vba]
    Sub Q()
    Sheets("RAW").Select
    Range("E2").Select
    lastrow = Cells(Rows.Count, 1).End(xlUp).Row

    MsgBox lastrow
    End Sub
    [/vba]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •