Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Debug Issue | Excel Discussion (Misc queries) | |||
debug | Excel Programming | |||
debug | Excel Programming | |||
Debug issue with macros | Excel Programming | |||
No debug box | Excel Programming |