Results 1 to 2 of 2
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    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.

    Good morning

    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"
    Exit Sub
    End If

    <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
    End With

    'Clear the data

    Me.cboName.Value = ""
    Me.txtDateFrom.Value = ""
    Me.txtDateTo.Value = ""
    Me.cboLeaveType.Value = ""
    Me.cboName.SetFocus

    End Sub

    Any ideas please?

    Cheers

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    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,
    Rudi

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •