Destination:=Range -- want it to refer to the current cell

lmcc007

New Member
Joined
Sep 9, 2018
Messages
35
Cell A4 has a date.

I recorded a macro to go to the cell to the right, which is A4. Grab the handle and bring it down to cell A5 to give me the next date.

Is there a way to change =Range("A4:A5") to reference the current cell?



Code:
Selection.AutoFill Destination:=Range("A4:A5"), Type:=xlFillDefault



And, is there a way to excludes Sundays from all future dates. Something like if Sunday, go to next day.
 
Wow, it works. Thank you very much! I am doing a lot of stuff manually. I've tried watching VBA videos, but I am still lost--something doesn't click in my brain.
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Your are welcome!
I've tried watching VBA videos, but I am still lost--something doesn't click in my brain.
Give yourself some time, there is a lot to learn! But using the Macro Recorder like you have is a good start!
And reading threads of interest on this forum are helpful too.

As always, feel free to post any questions here!:)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,329
Members
452,635
Latest member
laura12345

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