Need my macro to start by referencing the cell the button is in. The buttons move btw.

andrizee

New Member
Joined
Jun 28, 2018
Messages
1
I've struggled for probably 5 hours on this step. :( Can someone please help? I have Excel in R1C1 notation cuz I thought that would be helpful for this macro.
My macro in R6C1 works. When clicked, it generates a new range from R5C2 to R11C2 and shifts the other ranges to the right , including the "Delete Component" button that it produced. Currently, the "Delete Component" button is what I'm trying to produce a macro for in case a user wants to delete a component, i.e. the corresponding data below the button, as well as deleting the button itself, and shifting everything to the left. The closest I've come is to this bit of a macro I found online.

MsgBox ActiveSheet.Buttons(Application.Caller).TopLeftCell.Column

It outputs the column number that the "Delete Component" button is in, so I thought I could use part of it, but can't figure it out.

Your help would be so greatly appreciated.
 

Attachments

  • Excel Snapshot.JPG
    Excel Snapshot.JPG
    140.5 KB · Views: 7

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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