VBA - find the last cell with a specific color in a worksheet

pds493

New Member
Joined
Mar 6, 2014
Messages
19
I've been trying to make this work, but just can't get it. An alternative which would suffice is to find the last cell with a specific format, which in my case would be a date (Mar-22).

I am needing to write a macro which finds the most recent month and copy and paste said month into the next column to the right. For some reason these summary formulas (YTD, rolling average, etc.) are getting in the way of things. They are listed to the right after a blank column and Excel keeps recognizing them as the most recent month then inserting a column to the right of them.

The rectangle in the red is where I would like the Macro to take the most recent month (Mar-22) and copy paste for use in the next month. Please advise.

Thank you!
 

Attachments

  • Screen Shot 2022-06-21 at 10.17.03 AM.jpg
    Screen Shot 2022-06-21 at 10.17.03 AM.jpg
    90.9 KB · Views: 5

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,214,968
Messages
6,122,506
Members
449,089
Latest member
RandomExceller01

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