soultrain000
New Member
- Joined
- Dec 8, 2010
- Messages
- 37
Hi Fellows,
I am getting an "End With without With" compile error.
Can someone help please?
I am getting an "End With without With" compile error.
Can someone help please?
Code:
Sheets("Setup").Select
If (ActiveSheet.AutoFilterMode) Then ActiveSheet.AutoFilterMode = False
Range("I4").Select
xRow = Range("I4").End(xlDown).Row
Range("F4:BU" & xRow).Select
Selection.Name = "rawdata"
Range("N3").Select
x = ActiveCell.Address
Do Until ActiveCell.Value = ""
prop = ActiveCell
xCol = ActiveCell.Column
Sheets(prop).Select
sRow = (Range("F9").End(xlDown).Row) + 1
eRow = sRow + 2
'Range("A" & eRow & ":H10000").Select
'Selection.ClearContents
i = 9
Sheets("Rawact").Select
If (ActiveSheet.AutoFilterMode) Then ActiveSheet.AutoFilterMode = False
Rows("2:10000").Select
Selection.ClearContents
Sheets("Setup").Select
With Range("rawdata")
.AutoFilter Field:=i, Criteria1:="Yes"
xxRow = (Range("I4").End(xlDown).Row)
Worksheets("Setup").Range("F4:M" & xxRow).Copy
Sheets("Rawact").Range("A2").PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Sheets("Rawact").Select
raaRow = (Range("D2").End(xlDown).Row)
Range("I2").Formula = "=IF(ISNA(VLOOKUP(""?????""&A2,INDIRECT(""" & prop & "!A1:A10000""),1,FALSE)),1,0)"
Range("I2").Copy Range("I2:I" & raaRow)
Application.Calculation = xlCalculationAutomatic
If (ActiveSheet.AutoFilterMode) Then ActiveSheet.AutoFilterMode = False
If Range("I1").Value > 0 Then
With Range("A2:I" & raaRow)
.AutoFilter Field:=9, Criteria1:="1"
cRow = Range("D2").End(xlDown).Row
Worksheets("Rawact").Range("A2:H" & cRow).Copy
Sheets(prop).Select
Columns("A:C").Select
Selection.EntireColumn.Hidden = False
firstrow = Columns(1).Find("*", Cells(2, 1), SearchDirection:=xlNext).Row
lastrow = Range("A" & firstrow).End(xlDown).Row
Range("A" & lastrow + 1).Select
End With
Sheets(prop).Range("A" & lastrow + 1).PasteSpecial _
Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
finalrow = Range("A" & firstrow).End(xlDown).Row
For i = firstrow To finalrow
Cells(i, "A").Value = Cells(1, "A").Value & Cells(i, "B").Value & Cells(i, "C").Value & Cells(i, "D").Value & Cells(i, "E").Value
Next i
Sheets("Setup").Select
If (ActiveSheet.AutoFilterMode) Then ActiveSheet.AutoFilterMode = False
ActiveCell.Offset(0, 1).Select
x = ActiveCell
i = i + 1
End With
Loop
Call Protect
End Sub