Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 74
Default error in code

hi,
could anyone tell me what could possibly be wrong in my code - see remark
below? i keep on getting an error message
thanks

Private Sub Workbook_Open()
Const sAPPLICATION As String = "Excel"
Const sSECTION As String = "QUOTE1"
Const sKEY As String = "QUOTE1_key"
Const nDEFAULT As Long = 1&
Dim nNumber As Long

With ThisWorkbook.Sheets("3") (what could be wrong here?)
With .Range("F9")
If IsEmpty(.Value) Then
.Value = Date
.NumberFormat = "dd mmm yyyy"
End If
End With
With .Range("K2")
If IsEmpty(.Value) Then
nNumber = GetSetting(sAPPLICATION, sSECTION, sKEY,
nDEFAULT)
.NumberFormat = "@"
.Value = Format(nNumber, "0000")
SaveSetting sAPPLICATION, sSECTION, sKEY, nNumber + 1&
End If
End With
End With
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code error M&M[_2_] Excel Discussion (Misc queries) 4 July 13th 07 12:20 AM
Code error N.F[_2_] Excel Discussion (Misc queries) 1 July 2nd 07 11:13 PM
Error in Code N.F[_2_] Excel Discussion (Misc queries) 9 June 27th 07 06:48 PM
error in this code [email protected] Excel Worksheet Functions 2 December 5th 06 05:21 AM
Error Code 481 MBlake Excel Discussion (Misc queries) 1 May 11th 05 01:27 PM


All times are GMT +1. The time now is 02:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"