LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA issue, debug


hi, I'm having some trouble with the following VBA on an excel sheet
currently it has 3 check boxes, new, amend, delete which you should b
able to select, before entering in some details.
An error message box checks that the fields are completed and display
relevant error messages.
The work book has several sheet tabs, a front page, a page with th
check boxes on, and a third page where you can enter details, button
hyperlink between the sheet tabs.
Currently if you check the box marked "new" and move sheets you get
runtime error and "object doesn't support this method or property"
It breaks at the line highlighted in pink.

I was just wondering if anyone could help at all.

Thanks in advance! :)

Function sdaCheck()
'SDA
'--------------------------------------------------------------------------------

Dim SignOnErrStr As String
Dim textBoxValue As String
Dim firstName As String
Dim i As Integer
Dim RowNo As Integer
Dim signOn As String
Dim thisChckd As Boolean

'reset text box value
textBoxValue = ActiveWorkbook.Sheets("SDA").txtSDA.Text
thisChckd = False

'NEW:
If textBoxValue = "NEW" Then

'check each cells have values
If ActiveWorkbook.Sheets("SDA").Range("E7") < "" Then
thisChckd = True
ElseIf ActiveWorkbook.Sheets("SDA").Range("G7") < "" Then
thisChckd = True
ElseIf ActiveWorkbook.Sheets("SDA").Range("E8") < "" Then
thisChckd = True
ElseIf ActiveWorkbook.Sheets("SDA").Range("G8") < "" Then
thisChckd = True
Else
End If

'if they all are null then send error else do nothing.
If thisChckd = False Then
SignOnErrStr = SignOnErrStr & ActiveWorkbook.Sheets("Erro
MSGs").Range("C303") & vbCr
Else
End If


*If ActiveWorkbook.Sheets("ACD Logins").txtACD.Text < "" Then
Else*'set row value
RowNo = 14

'set signOn to the sign on field and put is in uppercase
signOn = UCase(ActiveWorkbook.Sheets("SDA").Range("G" & RowNo))

'set the user first name field
firstName = ActiveWorkbook.Sheets("SDA").Range("D" & RowNo)

'reset i
i = 0

For i = 1 To 9

If firstName < "0" Then
If signOn = "" Then
SignOnErrStr = SignOnErrStr & ActiveWorkbook.Sheets("Erro
MSGs").Range("C304") & _
" (SignOn: Row number " & RowNo - 13 & ")" & vbCr
ElseIf signOn = " " Then
SignOnErrStr = SignOnErrStr & ActiveWorkbook.Sheets("Erro
MSGs").Range("C305") & _
" (SignOn: Row number " & RowNo - 13 & ")" & vbCr
ElseIf Not IsNumeric(signOn) Then
SignOnErrStr = SignOnErrStr & ActiveWorkbook.Sheets("Erro
MSGs").Range("C306") & _
" (SignOn: Row number " & RowNo - 13 & ")" & vbCr
ElseIf Not IsNumeric(signOn) Then
Else
End If
End If

'reset the row number, firstName, signOn
RowNo = RowNo + 1
signOn = UCase(ActiveWorkbook.Sheets("SDA").Range("G" & RowNo))
firstName = ActiveWorkbook.Sheets("SDA").Range("D" & RowNo)

Next i

End If

sdaCheck = SignOnErrSt


--
opheli
-----------------------------------------------------------------------
ophelia's Profile: http://www.excelforum.com/member.php...fo&userid=3377
View this thread: http://www.excelforum.com/showthread.php?threadid=56236

 
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
Debug Issue DataGuy Excel Discussion (Misc queries) 3 April 15th 09 10:55 PM
debug Frank Kabel Excel Programming 0 September 22nd 04 06:22 AM
debug John Excel Programming 0 September 22nd 04 04:11 AM
Debug issue with macros Jess Excel Programming 1 June 23rd 04 03:54 PM
No debug box mushy_peas[_33_] Excel Programming 2 April 23rd 04 12:20 AM


All times are GMT +1. The time now is 07:23 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"