Results 1 to 2 of 2
2008-01-25, 11:24 #1
- Join Date
- Aug 2001
- Surrey, United Kingdom
- Thanked 0 Times in 0 Posts
Macro stops working after row 67? (2003 SP2)
***PLEASE IGNORE POST***
Reason: I had a hidden column that I had forgotten about 'E' which had to have a value from column D in order that the Calendar could be completed but somewhere between design and implementation stage I had not copied the formula contained therein all the way down.
I have a workbook with a macro that adds data to columns A,B,C and D, this data in turns adds dates to my holiday calendar, and it has been working fine up until now, however this morning I have tried to add data through my form and whilst it is completing columns A,B,C and D as it should any data after row 67 is not updating the holiday calendar, the macro is
Private Sub cmdAddLeave_Click()
Dim Irow As Long
Dim Iname As Long
Dim ws As Worksheet
Set ws = Worksheets("2008")
<font color=448800>'find first empty row in db</font color=448800>
Irow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Iname = Me.cboName.ListIndex
<font color=448800>'Check for a name</font color=448800>
If Trim(Me.cboName.Value) = "" Then
MsgBox "Please enter an employees name"
<font color=448800>'Copy the data to the database</font color=448800>
With ws <font color=448800>green</font color=448800>
.Cells(Irow, 1).Value = Me.cboName
.Cells(Irow, 2).Value = CDate(Me.txtDateFrom.Value)
.Cells(Irow, 3).Value = CDate(Me.txtDateTo.Value)
.Cells(Irow, 4).Value = Me.cboLeaveType.Value
'Clear the data
Me.cboName.Value = ""
Me.txtDateFrom.Value = ""
Me.txtDateTo.Value = ""
Me.cboLeaveType.Value = ""
Any ideas please?
Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)
2008-01-25, 13:03 #2
- Join Date
- Feb 2004
- Cape Town, RSA
- Thanked 1 Time in 1 Post
Re: Macro stops working after row 67? (2003 SP2)
...and i was just about to give you my reply: Check the 'hidden' E column to see if you filled your formula down all the way! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>Regards,