Noobie VBA Question

mcwilson

New Member
Joined
Jun 21, 2011
Messages
19
Sorry for the pathetic question, but I would love some help!

I have code to enter into VBA...I hit Alt-F11 and paste the code in. On the top it reads "General" and then "Worksheet Change".....is that correct?

Once the code is in, how do I run it?
If i go to the "Run" tab, the box comes up, but i do not have anything listed in there.....

Any help would be greatly apprecaited.

Thanks
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
If your code is in WorksheetChange, making any change [like entering something in a cell] should trigger your code to run.
 
Upvote 0
What's the code supposed to do?
  1. If it's meant to be triggered by a workbook-level event like the workbook opening or closing, then it belongs in the ThisWorkbook code module, with the Sub name selected from the drop-down.
  2. If it's meant to be triggered by a worksheet-level event like a cell being changed or the sheet being recalculated, then it belongs in the code module for that worksheet, with the Sub name selected from the drop-down.
  3. If it's meant to be called directly by the user from the Macros menu option, by a button or some other clickable 'thing' on the worksheet, or if it's a 'user-definable Function' (UDF), you would create a new 'general' or 'standard' code module for it by clicking Insert > Module in your VBA editor and pasting the code into that.
Which of those three is is, do you know?

Showing us the code might help us determine this if you don't know, but please paste it in its entirety between CODE tags - the # icons in the advanced editor toolbar.

If you got the code from the Web somewhere, letting us have the URL might also be helpful.
 
Upvote 0

Forum statistics

Threads
1,224,612
Messages
6,179,890
Members
452,948
Latest member
Dupuhini

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