For without Next error

I

iashorty

I had the following given to me to help me with a problem. I think this will
be the answer but I am getting an error message "For without Next". I don't
know how to solve this.



Set ImportSht = Windows("File_1.xls").Sheets("Import")

With Workbooks(File_2)
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
For RowCount = 1 To LastRow
If .Range("A" & RowCount) <> "" Then
ImportRow = ImportSht.Range("A" & Rows.Count).End(xlUp).Row
ImportRow = ImportRow + 1
StartCell.Value = .Range("A" & ImportRow)
StartCell.Value.Offset(1, 0) = .Range("B" & RowCount)
StartCell.Value.Offset(2, 0) = .Range("C" & (RowCount + 1))
StartCell.Value.Offset(3, 0) = .Range("D" & (RowCount + 7))
StartCell.Value.Offset(4, 0) = .Range("C" & (RowCount + 30))
StartCell.Value.Offset(5, 0) = .Range("D" & (RowCount + 30))
StartCell.Value.Offset(6, 0) = .Range("E" & (RowCount + 30))
StartCell.Value.Offset(7, 0) = .Range("F" & (RowCount + 30))
StartCell.Value.Offset(8, 0) = .Range("G" & (RowCount + 30))
End If
End With
 
I

iashorty

Thank you. I got past that error and have another error on the first line
Set ImportSht=Windows("File_1.xls").Sheets("Import")

error is: Object doesn't support this object or method.

What do I need to look for to correct this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top