Why am I getting a runtime 1004 error? VBA

Discussion in 'OT Technology' started by Acoustyk, Jul 28, 2008.

  1. Acoustyk

    Acoustyk Jesus didn't save the dinosaurs lol

    Joined:
    May 31, 2007
    Messages:
    224
    Likes Received:
    0
    Location:
    The vicinity of Richmond, VA
    The error says that the application is not defined. I marked the problem line below with"<<<<<<<<<<<<<"

    Private Sub showx() 'regulates the show and x for the CST report
    Dim x As Integer
    Dim a As Integer
    Dim b As Integer
    Dim f As Integer

    x = 12
    f = 1
    Do
    a = 25
    b = 18


    Select Case Worksheets("TimesheetRich").range("BH" & x).Value

    Case "show"
    Do
    If Worksheets("TimesheetRich").range("BF" & a).Value = f Then

    Worksheets("CSTReport").range("N" & b).Value = Worksheets("TimesheetRich").range("N" & a).Value <<<<<<<<<<<<<<<
    Worksheets("CSTReport").range("Q" & b).Value = Worksheets("TimesheetRich").range("Q" & a).Value
    Worksheets("CSTReport").range("T" & b).Value = Worksheets("TimesheetRich").range("T" & a).Value
    Worksheets("CSTReport").range("Y" & b).Value = Worksheets("TimesheetRich").range("Y" & a).Value
    Worksheets("CSTReport").range("AB" & b).Value = Worksheets("TimesheetRich").range("AB" & a).Value
    Worksheets("CSTReport").range("AE" & b).Value = Worksheets("TimesheetRich").range("AE" & a).Value
    Worksheets("CSTReport").range("AH" & b).Value = Worksheets("TimesheetRich").range("AH" & a).Value
    Worksheets("CSTReport").range("AN" & b).Value = Worksheets("TimesheetRich").range("AN" & a).Value
    Worksheets("CSTReport").range("AQ" & b).Value = Worksheets("TimesheetRich").range("AQ" & a).Value

    a = a + 1
    b = b + 1
    Else
    a = a + 1
    b = b + 1
    End If
    Loop Until a = 276 And b = 269
    End Select

    x = x + 1
    f = f + 1
    Loop Until x = 20 And f = 9

    End Sub

    What should I do? I tried using "Sheets" instead of "Worksheet" but to no avail. If you have any ideas let me know, because it seems like it should work.
     

Share This Page