Auto fill down

  • Thread starter Thread starter Dominique Feteau
  • Start date Start date
D

Dominique Feteau

Nigel

Your macro excerpt worked like a charm. I was also able to tweek it to do a
couple of columns. I do have one question tho. How do i tweek it so it'll
do an autofill instead of just a copy and paste?

Thanks in advance
Niq

Copy of macro below:

Dim LastRow As Long
LastRow = Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
Range("B1").Copy
Range("B2:B" & LastRow).Select
ActiveSheet.Paste
Application.CutCopyMode = False
 
Try this

Sub test()
Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("B1:B" & LastRow).FillDown
End With
End Sub
 
That didnt work. It just copies whatever is in that cell. doesnt continue
the series.
 
since you are pasting a multicell range, what do you mean by filldown.
Filldown based on what?
 
Hi Dominique

If there is a formula in B1 it will work
If there is a value then you get the same value.
the series.
what do you want to do
 
Ron

I have "Safety04-3000" in that cell as text. I want it to fill down the
series (e.g. Safety04-3001, Safety04-3002, etc.). but stop at the last row.

Niq
 
Try this then

Sub test()
Dim LastRow As Long
With Worksheets("Sheet1")
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
.Range("B1").AutoFill Destination:=.Range("B1:B" & LastRow) _
, Type:=xlFillDefault
End With
End Sub
 
thanx ron...i was close to that solution, but i set up my range incorrectly.

niq
 

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