Use macro to click a shape to enlarge it

Koala123

New Member
Joined
Apr 13, 2019
Messages
24
Office Version
  1. 365
Hi guys, I found a excel template which is pretty cool, one of its highlights is when you click a title tag it will enlarge and turn into orange, the title tags are built into excel shapes, I know there is macro behind them but I could't understand the logic of the codes. Can anyone please help me understand which part of the macro dose the enlarging trick here, and how does it work??? Thank you guys!

Below is the effect.

VEomtS.png


Sub Hotel_Bar1()


Range("City_Bar") = 1
AAA = Range("City_Bar1")


Sheets("Hotel").Select
Sheets("Hotel").Shapes("HBar 1").Select


With Selection
.Max = AAA
End With


Range("City_Bar") = Range("Destination_City3") - 1
If Range("City_Bar") = 0 Then Range("City_Bar") = 1


Range("a1").Select
End Sub
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I am trying the codes line by line, but ran into a error when executing:

With Selection
.Max = AAA
End With

Can anyone please help me understand what does the above part do?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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