Results 1 to 8 of 8

Thread: Autofilling in VBA through the last row

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    4
    Rep Power
    0
    Thank you so much for the response. I appreciate the tip about the redundancy of the .Select/Selection. pairing. I've learned most of my VBA coding by studying the output of the macro recorder, and separating the selection and acting on the selection is surely a result of that.

    With your code I still run into problems if there is only data on rows 1 and 2. I have written a workaround using IF THEN, but I'd be interested to know if there is a way of sort of defining ranges "on the fly" that would allow for data only in rows 1 and 2, or even just in row one, since the data sets I'll be applying this code to will sometimes only have the header/label row and no data rows (for this particular sheet in the workbook).

    Is the problem that the "Cells(Rows.Count, "A").End(xlUp).Row" part can't return the same row number as the "H2:H" part?

    Thanks again.

    -JP
    Last edited by jardenp; 03-29-2013 at 07:10 PM.

Similar Threads

  1. Highlight Current Row in Excel (VBA)
    By Admin in forum Excel and VBA Tips and Tricks
    Replies: 16
    Last Post: 07-31-2013, 06:46 AM
  2. VBA code to move row to new spreadsheet
    By cdurfey in forum Excel Help
    Replies: 6
    Last Post: 06-10-2013, 10:38 PM
  3. Replies: 7
    Last Post: 05-17-2013, 10:38 PM
  4. Copy Table Range Till Last Row Using VBA
    By ivandgreat in forum Excel Help
    Replies: 2
    Last Post: 05-09-2013, 05:41 PM
  5. Vba Code to find value and paste on certain row
    By jwitte in forum Excel Help
    Replies: 3
    Last Post: 11-28-2012, 08:52 PM

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
  •