Enhance macro

Mikal

Board Regular
Joined
Aug 31, 2015
Messages
73
I have a spread sheet that uses a user form, currently have to open the sheet, decide if you want to create or modify the part number, then when updated you have to hit enter 7 times to run the macros. I would like to be able to populate the part number column and when I click on it opens up, Blank if it is new, (just the part #) or populated so you can review and modify. Also when it close I want it to just run all the macros so I only have to hit enter once. Is this possible?

Any help will be appreciated.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
To run a macro on close of the book use this by Mark O'Brien:

https://www.mrexcel.com/forum/excel-questions/5429-how-run-macro-close.html


1. In the VBE (Open Excel ALT+F11), double click on "ThisWorkbook".
2. In the left drop down, choose Workbook.
3. On the right dropdown menu choose "BeforeClose"
4. Put your macro name after the line:


Private Sub Workbook_BeforeClose(Cancel As Boolean)

You can also run a private sub to run when you click on a cell in a column. Just change the column number below in .Column = x

https://www.mrexcel.com/forum/excel-questions/118901-run-macro-if-selection-specific-column.html

by R_Stephens
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 3 Then

'your code here

End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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