Hi there,
I have a code that erase data in a sheet, but the sheet is hidden. the code work well when the sheet is visible, but I dont want it to be visible. How can I make add to the code to unhide the sheet, clear all the data, and hide it again? no password is needed.
my code:
Sub Help_Rectangle16_Click()
'Overall warning
'Clear Content of Drawings
MSG2 = MsgBox("This action will remove the data in this database system.Do you want to continue?", vbYesNo, "Warning")
If MSG2 = vbYes Then
'Clear Content of Drawings
MSG2 = MsgBox("Do you want to Delete the Drawings database?", vbYesNo, "Drawings?")
If MSG2 = vbYes Then
Sheets("Drawings").Select
Cells.ClearContents
Range("A1").Select
Else
MsgBox "Drawing database not deleted"
End If
'Clear Content of Issues
MSG2 = MsgBox("Do you want to Delete the Issues database?", vbYesNo, "Issues?")
If MSG2 = vbYes Then
Sheets("Issues").Select
Cells.ClearContents
Range("A1").Select
Sheets("Distribute").Select
Cells.ClearContents
Range("A1").Select
Else
MsgBox "Issues database not deleted"
End If
'Clear Content of Participants
MSG2 = MsgBox("Do you want to Delete the Participants database?", vbYesNo, "Participants?")
If MSG2 = vbYes Then
Sheets("Participants").Select
Cells.ClearContents
Range("A1").Select
Sheets("Distribute").Select
Cells.ClearContents
Range("A1").Select
Else
MsgBox "Participants database not deleted"
End If
'Clear Content of ProjectInfo
MSG2 = MsgBox("Do you want to Delete the Project Info database?", vbYesNo, "Project Info?")
If MSG2 = vbYes Then
Sheets("ProjectInfo").Select
Cells.ClearContents
Range("A1").Select
Else
MsgBox "ProjectInfo database not deleted"
End If
Else
MsgBox "Operation cancelled"
End If
End Sub
best regards,
Jakes
Bookmarks