Results 1 to 3 of 3

Thread: Select rows with data in column A5 down then resize to 11 columns along (K)

  1. #1

    Select rows with data in column A5 down then resize to 11 columns along (K)

    Hello all,

    I am stuck on this which i think should be quite easy but i cant work it out. I need to select cells in coumn A from A5 down where cells are not blank, then resize the selection to column K. The below code runs fine but does not select anything. Any help would be wonderful. Thank you.
    Code:
    With ShipmentTimelinessWeekPrevious.Sheets("Data")
    Dim RowHeight As Range
    Set RowHeight = .Range("a5", Range("a5").End(xlDown))
    .Range("A5").Select
    Selection.Resize(RowHeight, 11).Select
    End With

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    https://www.eileenslounge.com/viewtopic.php?f=44&t=40455&p=313035#p313035
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312889#p312889
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312886#p312886
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312752#p312752
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312734#p312734
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312727#p312727
    https://www.eileenslounge.com/viewtopic.php?f=18&t=40411&p=312724#p312724
    https://www.eileenslounge.com/viewtopic.php?f=44&t=40374&p=312535#p312535
    https://www.eileenslounge.com/viewtopic.php?p=312533#p312533
    https://www.eileenslounge.com/viewtopic.php?f=44&t=40373&p=312499#p312499
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=Ugy_RiNN_kAqUvZ8W994AaABAg. 9xhyRrsUUOM9xpn-GDkL3o
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=Ugy_RiNN_kAqUvZ8W994AaABAg
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=UgzlC5LBazG6SMDP4nl4AaABAg
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=UgzlC5LBazG6SMDP4nl4AaABAg. 9zYoeePv8sZ9zYqog9KZ5B
    https://www.youtube.com/watch?v=jTmVtPHtiTg&lc=Ugy_RiNN_kAqUvZ8W994AaABAg. 9xhyRrsUUOM9zYlZPKdOpm
    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 03-01-2024 at 03:02 PM.

  2. #2
    Hi, All sorted. Think the problem was i was trying to resize the selection rather than the current range.
    Code:
    With ShipmentTimelinessWeekPrevious.Sheets("Data")
    Dim RowHeight As Range
    Set RowHeight = Range(Range("A5"), Range("A5").End(xlDown))
        RowHeight.Resize(, RowHeight.Columns.Count + 10).Select

  3. #3
    Junior Member
    Join Date
    Jan 2012
    Posts
    10
    Rep Power
    0
    Code:
    Range(Cells(5,1), Cells(Rows.Count, "A").End(xlUp)).Resize(,11).Select
    This should replace the two lines of code. Select is very seldom needed and you should see if you can adapt the code.
    Using xlDown could be dangerous if there is a blank cell in the range.

Similar Threads

  1. seprate data in rows to columns
    By CORAL in forum Excel Help
    Replies: 2
    Last Post: 03-10-2014, 08:18 AM
  2. Replies: 1
    Last Post: 10-25-2013, 10:37 PM
  3. Replies: 6
    Last Post: 08-14-2013, 04:25 PM
  4. Replies: 3
    Last Post: 07-29-2013, 11:32 PM
  5. Move data from rows into columns for every unique value
    By mahmoud-lee in forum Excel Help
    Replies: 4
    Last Post: 06-13-2013, 03:02 AM

Tags for this Thread

Posting Permissions

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