Hello,
I am looking for any assistance in relation to Excel Macros and VBA
I am currently using the following on my Excel Workbooks (which were kindly provided by people on MrExcel)
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+z
'
Dim ws As Worksheet
For Each ws In Sheets
ws.Activate
Range("C1:Z10").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next ws
End Sub
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+y
'
Dim ws As Worksheet
For Each ws In Sheets
ws.Activate
Range("C14:Z2060").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next ws
End Sub
Sub ProtectWB_Protect_All_Sheets()
Dim ws As Worksheet
ActiveWorkbook.Unprotect
For Each ws In Worksheets
ws.Protect
Next
ActiveWorkbook.Protect
End Sub
These Macros turn RandBetween numbers into fixed / non-changing 'values', instead of having changing output of the RandBetween formula every-time I open / use the workbook / worksheet. The last one locks the workbook.
My situation is as follows:
My questions are:
Any help will be gratefully appreciated.
Robbert
I am looking for any assistance in relation to Excel Macros and VBA
I am currently using the following on my Excel Workbooks (which were kindly provided by people on MrExcel)
Sub Macro1()
'
' Macro1 Macro
'
' Keyboard Shortcut: Ctrl+z
'
Dim ws As Worksheet
For Each ws In Sheets
ws.Activate
Range("C1:Z10").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next ws
End Sub
Sub Macro2()
'
' Macro2 Macro
'
' Keyboard Shortcut: Ctrl+y
'
Dim ws As Worksheet
For Each ws In Sheets
ws.Activate
Range("C14:Z2060").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next ws
End Sub
Sub ProtectWB_Protect_All_Sheets()
Dim ws As Worksheet
ActiveWorkbook.Unprotect
For Each ws In Worksheets
ws.Protect
Next
ActiveWorkbook.Protect
End Sub
These Macros turn RandBetween numbers into fixed / non-changing 'values', instead of having changing output of the RandBetween formula every-time I open / use the workbook / worksheet. The last one locks the workbook.
My situation is as follows:
- I have a workbook with 24 worksheets
- I need to create 100 individual workbooks, with each workbook having 24 sheets, most likely using the original as a master to make copies from
- Each worksheet, 24 per workbook, has the same structure and layout - with the affected RandBetween content in cells C1 to Z10, and C14 to Z2060
My questions are:
- Firstly, is it possible to combine these three Macros into one Macro? Or even the first two into one Macro?
- Secondly, and more importantly, is it possible to create / design a VBA to apply the above macros to all 100 workbooks (affecting each of the 24 worksheets in each of the 100 workbooks simultaneously), without physically needing to open each workbook individually and apply those macros to each individual workbook?
Any help will be gratefully appreciated.
Robbert