Selecting & Pasting Dynamic Ranges

  • Thread starter Thread starter GerryM
  • Start date Start date
G

GerryM

I have a sheet with 10000 rows but this can vary. Columns
A to C always have text in all rows. I want to paste a
value from Row 2 column A to all rows in Column D. As the
number of rows can vary how can I do this with a macro
with having to manually tell it how many rows there are.

GerryM
 
from a post of mine a few minutes ago

determine your last row with something like
lr=cells(rows.count,"a").end(xlup).row
 
Try this:

Sub FillColD()

Dim RowCount As Long, i As Long

For i = 2 To (Cells(Rows.Count, "A").End(xlUp).Row)
Cells(i, 4).Value = Cells(2, 1).Value
Next i

End Sub


Regards,
ManualMan
http://www.gamesXL.tk
 
This almost works, however the cell content I want to copy
is a formula and I want to copy the formula
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top