Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi!
Could an expert spot what is wrong with this chunk? For f = 1 To 39 If Not Workbooks("BCS Summary Lines.xls").Worksheets(1).Cells(f + 9, 105) = Workbooks("BCS Summary Lines.xls").Worksheets(1).Cells(f + 10, 105) Then Range("d10:cz477").ClearContents Range(Cells(f + 9, 4), Cells(f + 9, 4).Offset(11, 100)).Value = Range(Cells(f + 1009, 4), Cells(f + 1009, 4).Offset(11, 100)).Value Workbooks("BCS Summary Lines.xls").Worksheets(1).Range(Cells(f + 9, 4), Cells(f + 9, 4).Offset(11, 100)).Value = Workbooks("BCS Reports.xls").Worksheets(1).Range(Cells(f + 9, 4), Cells(f + 9, 4).Offset(11, 100)).Value Else Cells(f + 25, 130) = f End If Next f The following works! For f = 1 To 39 If Not Workbooks("BCS Summary Lines.xls").Worksheets(1).Cells(f + 9, 105) = Workbooks("BCS Summary Lines.xls").Worksheets(1).Cells(f + 10, 105) Then Range("d10:cz477").ClearContents Range(Cells(f + 9, 4), Cells(f + 9, 4).Offset(11, 100)).Value = Range(Cells(f + 1009, 4), Cells(f + 1009, 4).Offset(11, 100)).Value Range(Cells(f + 9, 4), Cells(f + 9, 4).Offset(11, 100)).Value = Workbooks("BCS Reports.xls").Worksheets(1).Range(Cells(f + 9, 4), Cells(f + 9, 4).Offset(11, 100)).Value Else Cells(f + 25, 130) = f End If Next f The difference is Workbooks("BCS Summary Lines.xls").Worksheets(1). has been removed from the first chunk - 7th line Both workbooks are unprotected. Thank You. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to do it - please help me! Urgent. | Excel Discussion (Misc queries) | |||
IME MODE FOR EXCEL 2007 (URGENT URGENT) | Excel Discussion (Misc queries) | |||
Urgent-Urgent VBA LOOP | Excel Discussion (Misc queries) | |||
Macro help urgent urgent | Excel Programming | |||
Macro help urgent urgent | Excel Programming |