Hello everyone, this is my very first time posting.
I have the following code which is set up, basicly I want to have cell O2 auto update when I click the button I have added.
It works fine if I do not lock the cell, but if I don't lock the cell it clears it back to blank as I have all unlocked cell being cleared as well.
Any help would be greatly appreceated.
Thanks
mclark15
Cell O:2 is set up for auto invoice number and I also have code there for clearing unlocked cells. If I lock cell O:2 it does not work.
Is there a way to lock this cell and still get the auto numbering code to work.
Sub SaveAs()
Const Variable1 As String = "22032011"
Application.Dialogs(xlDialogSaveAs).Show "Report" & Variable1 & ".xls"
Range("O2").Value = Range("O2").Value + 1
Dim ws As Worksheet
Dim xshape As Shape
For Each ws In ThisWorkbook.Worksheets
For Each xshape In ws.Shapes
If xshape.Type = msoFormControl Then
xshape.ControlFormat.Value = False
End If
Next
Next
Dim c As Range
For Each c In Sheets("FrameChecklist").UsedRange
If c.Locked = False Then
c.Value = ""
End If
Next
End Sub
Bookmarks