Good Afternoon everyone,
Currently I am dealing with the issue of a macro that always refers to the one excel worksheet in which I have recored the macro. I have around 300 worksheets that I would like to use the macro on. My question is how I can adjust the code in order to refer to any of these worksheets and not just the one in which I have recorded it.
CASE
In the following I have listed part of the code, whereas the crucial part is shown by the definition "Sheets("6110").Select", in which the macro always refers to the sheet "6110" and not to the one im working with. Furthermore, all worksheets are protected with the same password, means I would like to implement the process in which the macro unprotects the sheet in the beginning of the code and protects it again at the end of the operation.
(Macro code visual basics)
Sheets("6110").Select
ActiveSheet.Unprotect
Range("C5:C13,D4:P13").Select
Range("D4").Activate
With Selection.Font
.Name = "Calibri"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With