gblue3223

New Member
Joined
Aug 6, 2015
Messages
3
I am working in VBA and am having an issue trying to get my information to copy down a formula until there is no data. The ranges of which to copy down changes so cant do a certain range. I have the formula in cell S4 and want it to be filled down. I am basing the data off column E that is 14 columns to the left of S where the fill down is. It will run thru this and then when it loops it will show this error- "Method Range of Object_Global Failed, Run time error 1004. Kind of lost on how to fix this or if im even on the right track. Any help would be much appreciated.

Sheets("SFDC Data FY").Select
Range("S4").Select
Do Until ActiveCell = ""
ActiveCell.AutoFill Destination:=Range(ActiveCell.Offset(0, -14)).Select
Loop
Introw = ActiveCell.Row
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hello and Welcome!

To do this without a macro select the whole range that you want to fill. Then F5 (or Ctrl+G) Special/Blanks/ok and press "=" sign and point up arrow and Ctrl+Enter.
 
Upvote 0
ok, try:

Code:
Sub filldown()
Application.ScreenUpdating = False
i = 2
lst = Cells(Rows.Count, "S").End(xlUp).Offset(1).Row
While i < lst
If Cells(i, 19) = "" Then Cells(i, 19) = Cells(i - 1, 19)
i = i + 1
Wend
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Sorry that doesn't quite make sense. All i am trying to do is get the VBA portion i screenshotted to pull a formula from column S down all the way to match with data entered in coulmn E.
 
Upvote 0
like that?

Code:
Sub filldown()
lst = Cells(Rows.Count, "E").End(xlUp).Offset(1).Row
Cells(4, 19).Resize(lst - 4).filldown
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,914
Members
449,132
Latest member
Rosie14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top