View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Macro, Copy Selected Cells Down a Column

If you can tell the macro how to figure out what the last row should be, then
yep.

Can you pick out a column that always has data in it when the row is used?

For instance, if you said A always had data in it:

Option Explicit
Sub Testme01()

Dim Rng As Range
Dim LastCell As Range
Dim LastRow As Long

With ActiveSheet
Set Rng = Selection.Columns(1)
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
Set LastCell = .Cells(LastRow, Rng.Column)

Rng.AutoFill _
Destination:=.Range(Rng, LastCell), Type:=xlFillCopy
End With
End Sub

But I don't know enough about your file to really guess.

DB33 wrote:

Ok, here's another thing Ijust noticed, I decided to unhide my Columns D & E,
and when I fill out C, then I can do D, E, F no problem.. as long as the
column preceding is filled.

Is there any way we can change the code so that I can do it in a random order,
say for example, fill out G, and then C, since there are really no link
between the columns anyways.. they can all have different values.


--

Dave Peterson