Macro to Shift object

maggotnap

New Member
Joined
May 12, 2011
Messages
6
Hi,

I have cells I want to highlighted with a circle on a budget. I want to have a shape named "Oval 3", do the highlighting. This is clearly easy to do manually.

However, I am trying to shift the circle (Oval 3) from Cell A10, to B10 (19pixels) and onward to Z10(based on a cell "A1". A1 is populated with today's ("=today()") date. So as the date moves/increases on I want the circle to move to the new (next) cell over on row 10, to highlight the remaining cash/budget.

Column length is 19 pixels

Anyone have any ideas?
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Welcome to the Board!

Take a look at the TopLeftCell property in the VBA helpfile. You can position the object based on that.

HTH,
 
Upvote 0
What you want to do can only be accomplished with VBA code.

You can record a macro moving the oval to the positions you want, which will give you an idea about how VBA works with object placement.

Then I'd probably use Application.WorksheetFunction.Match to locate the current date in the data, and once you've identified it, use the TopLeftCell property based on that location to place the oval.

Unfortunately, I don't really have time to create an example, but if you get stumped I'll see what I can come up with a bit later.
 
Upvote 0

Forum statistics

Threads
1,224,581
Messages
6,179,668
Members
452,936
Latest member
anamikabhargaw

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