Variables in a Range method

Brock_Hardchest

New Member
Joined
Feb 23, 2018
Messages
27
Hello,

I am trying to fill down a range of cells based off of the bottom row in two different worksheets. The .FillDown line of code errors and I am not sure why. Any help is appreciated. Thanks!

VBA Code:
Sheets("sheet1").Activate
row = Cells(Rows.Count, 1).End(xlUp).row
Range("A3:V" & row).Copy
Sheets("All Data").Activate
row2 = Cells(Rows.Count, 1).End(xlUp).row
Debug.Print row; " "; row2
Range("A" & row2 + 1).PasteSpecial
Range("W" & row2 + 1).Value = monthend 'this is a date set in the macro
Range("W" & row2 + 1 & ":W" & row + row2).FillDown
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Change the Variable row to Row1 or something else, you should never use VBA keywords as variables.
here
Rich (BB code):
row = Cells(Rows.Count, 1).End(xlUp).row
you have used row twice & it's two totally different things. How is VBA meant to understand what you mean. ;)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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