Multiple Macro's within 1 workbook

DonnaA

New Member
Joined
Mar 10, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I'm really new to using Macro's (so this may be a pretty simple question). I've added a Macro to our Work Order that will increase the WO # number by 1 every time it opens and it is working well. But within the same Workbook on a different Worksheet there's a Delivery slip that has a numerical sequence I would like to do the same but I can't seem to get that one to work. Here is what I've written in the Visual Basic showing what I've entered to create the Macro (see pic below). Can anyone help I would really appreciate it.
1678485785858.png
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Notice how the top Window in your picture is "Workbook" and the second Window is "Gerneral"? Try putting the the line in the second window below the line in the first Window. Saving. And testing.
VBA Code:
Private Sub Workbook_Open()
Range("G5").Value = Range("G5").Value +1
Range("H38").Value = Range("H38").Value +1
End Sub
 
Upvote 0
Notice how the top Window in your picture is "Workbook" and the second Window is "Gerneral"? Try putting the the line in the second window below the line in the first Window. Saving. And testing.
VBA Code:
Private Sub Workbook_Open()
Range("G5").Value = Range("G5").Value +1
Range("H38").Value = Range("H38").Value +1
End Sub
Thank you so much this worked :)
Not sure why I thought I would need 2 macro's, it didn't occur to me to combine them :)
Appreciate the help !!!!
 
Upvote 0
Thank you so much this worked :)
Not sure why I thought I would need 2 macro's, it didn't occur to me to combine them :)
Appreciate the help !!!!
Np. Happy to help.
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,453
Members
448,967
Latest member
grijken

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