Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone know why the following code returns a "1004 error" when i
tries to paste? All the worksheets (those starting Wht) have bee defined correctly but it seems not to recognise them? Dim Cell As Variant For Each Cell In WhtCode.Range("N2:N30") If Cell.Value < "0" Then WhtData.Range(Cell.Value).Cut WhtData.Range(WhtData.Cells(Row, 26)).PasteSpecia xlValues End If Next Cell I've tried using different syntax e.g. worksheets("data")...an altering the reference Row to e.g. a number but to no avail. Any ideas? thank -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
sorry, figured it out: Cells syntax was wrong! eek:
For the record, the correct code now reads: Dim Cell As Variant For Each Cell In WhtCode.Range("N2:N30") If Cell.Value < "0" Then whtData.Range(Cell.Value).Cut whtData.Range(whtData.Cells(Cell.row, 26) whtData.Cells(Cell.row, 26)).Select ActiveSheet.Paste End If Next Cel -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run-time error '50290': Application-defined or object-defined erro | Excel Discussion (Misc queries) | |||
Application-defined or object-defined error Please Help | Excel Discussion (Misc queries) | |||
Macro error : Application-defined or object-defined error | Excel Discussion (Misc queries) | |||
Application-defined or object-defined error | Excel Programming | |||
Runtime Error 1004 -- Application Defined or Object Defined Error | Excel Programming |