Hi,
I am a frequent reader of this forum and learned quite a lot from you guys so I hope you can help me in my current situation as well because I haven't found the answer anywhere.
I have a big file that I have been working with for a while. Many formulas, links between tabs and so on. Not many macro's. But the ones I have are for hiding and unhiding some of the columns. Until some recent modifications everything was working fine. But recently (and I don't know what might have caused it) the macro's start acting up. For example:
Sub Viewadj()
ActiveSheet.Unprotect
If Columns("AH:AM").Hidden = True Then
Columns("AH:AM").Hidden = False - stops after completing this step
Else:
Columns("AH:AM").Hidden = True - or this step
End If
ActiveSheet.Protect
End Sub
If I run this macro, as simple as it looks, once there is some action done on the sheet (the two lines in bold) the macro stops without any message. Simply is done. Similar thing happens here:
Sub ExportN()
Select Case MsgBox("...", vbYesNo, "...Results")
Case vbYes
j = 1
ActiveSheet.Unprotect ("Cr8y92Bq5")
Range(Cells(36, 143), Cells(162, 143)).ClearContents - exits
j = 36
For i = 36 To 162
As soon as the macro clears the contents of those cells it stops without a message.
The interesting thing - if I run these same codes in other worksheets within the same file, it works fine.
All my worksheet calls are blank so nothing there. But something clearly happens when I make a change to the sheet and can't figure out why and how to stop it.
Thank you in advance!
I am a frequent reader of this forum and learned quite a lot from you guys so I hope you can help me in my current situation as well because I haven't found the answer anywhere.
I have a big file that I have been working with for a while. Many formulas, links between tabs and so on. Not many macro's. But the ones I have are for hiding and unhiding some of the columns. Until some recent modifications everything was working fine. But recently (and I don't know what might have caused it) the macro's start acting up. For example:
Sub Viewadj()
ActiveSheet.Unprotect
If Columns("AH:AM").Hidden = True Then
Columns("AH:AM").Hidden = False - stops after completing this step
Else:
Columns("AH:AM").Hidden = True - or this step
End If
ActiveSheet.Protect
End Sub
If I run this macro, as simple as it looks, once there is some action done on the sheet (the two lines in bold) the macro stops without any message. Simply is done. Similar thing happens here:
Sub ExportN()
Select Case MsgBox("...", vbYesNo, "...Results")
Case vbYes
j = 1
ActiveSheet.Unprotect ("Cr8y92Bq5")
Range(Cells(36, 143), Cells(162, 143)).ClearContents - exits
j = 36
For i = 36 To 162
As soon as the macro clears the contents of those cells it stops without a message.
The interesting thing - if I run these same codes in other worksheets within the same file, it works fine.
All my worksheet calls are blank so nothing there. But something clearly happens when I make a change to the sheet and can't figure out why and how to stop it.
Thank you in advance!