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

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
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,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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