Hi,
I am fairly new in vba.
I have a situation where i would like to hide and delete a few sheets in my worksheet.
there is a few sheets where i want it to be constantly visible and one sheet is based on a cell reference.
the remaining irrelevant sheets i would like it to be hidden and deleted.
How do i go about this?
'always visible are sheets that are constantly visible in all files'
'visible msds is the sheet where my product data is being pulled out based on a input i enter on my first sheet'
the sheets i want to hide and delete will be the remaining irrelevant "MSDS" that i would like to remove through macro.
Sub hide()
'always visible'
Worksheets("Input").Visible = xlSheetVisible
Worksheets("Check sheet").Visible = xlSheetVisible
Worksheets("Component Description").Visible = xlSheetVisible
'visible msds'
Dim rng As Range
Dim wks As Worksheet
Set rng = Sheets("Input").Range("B3")
Set wks = Sheets(rng.Value)
wks.Visible = xlSheetVisible
Thanks guys,
Hopefully you all can help me in this.
Bookmarks