Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debug?

Status
Not open for further replies.

Funkymatt

Programmer
Aug 27, 2002
101
US
What's wrong with this...it's too simple?

Sub InsertDate()
If Worksheets("NothernTrust").Cells(1, 1).Value = Date Then
'Note that A =1, B =2, C=3, D=4, E=5, F=6, G=7 Sheet1.Cells(Row#, Column#)

MsgBox "No action has been taken. This worksheet has alredy been modified today."
'Do nothing, it had already been edited

Else
'Date not accurate, select the column to move then shift it to the right

Worksheets("NothernTrust").Cells(1, 1).Value = Date
End If
End Sub
 
I couldn't see anything wrong so I tested it only changing NothernTrust to sheet1 and it worked. What's it doing?
 
Funny....so I changed the name of my sheet from NorthernTrust to Sheet1 and now it works....

Prior to the change it was giving me an "Out Of Range" error..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top