Macro debug - Runtime error 1004 - no data to parse?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I have a macro which will not complete its last step. The
step involves dividing several columns by 10. To do this
i entered the number 10 into a cell. hit copy > selected
the columns i am dividing> right mouse >paste special >
checked off divide, and values. It worked fine when i was
recording the macro but now when i run it i get a runtime
error 1004.
Does anyone know how to fix this?
(not sure if i should paste the macro here because of its
size?)

chris
 
Chris,

Show us the code.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
alright here it is. my aplogies for the size of it. i'm
not sure what is/isn't important...

Columns("J:J").Select
Selection.Cut
Columns("G:G").Select
Selection.Insert Shift:=xlToRight
Columns("J:J").Select
Selection.Cut
Columns("H:H").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.SmallScroll ToRight:=10
ActiveWindow.Zoom = 85
Columns("T:T").Select
Selection.Cut
Columns("K:K").Select
Selection.Insert Shift:=xlToRight
Columns("S:S").Select
Selection.Cut
Columns("L:L").Select
Selection.Insert Shift:=xlToRight
Columns("P:P").Select
Selection.Cut
Columns("M:M").Select
Selection.Insert Shift:=xlToRight
Columns("R:R").Select
Selection.Cut
Columns("N:N").Select
Selection.Insert Shift:=xlToRight
Columns("O:P").Select
Selection.Cut
Columns("W:W").Select
Selection.Insert Shift:=xlToRight
Columns("T:T").Select
Selection.Cut
Columns("S:S").Select
Selection.Insert Shift:=xlToRight
Columns("R:R").Select
Selection.Cut
Columns("O:O").Select
Selection.Insert Shift:=xlToRight
Columns("R:R").Select
Selection.Cut
Columns("P:P").Select
Selection.Insert Shift:=xlToRight
ActiveWindow.Zoom = 100
Columns("F:F").Select
Range("F3").Activate
Selection.Delete Shift:=xlToLeft
Range("F10").Select
ActiveCell.FormulaR1C1 = "RTG"
With ActiveCell.Characters(Start:=1, Length:=3).Font
.Name = "MS Sans Serif"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("G10").Select
ActiveCell.FormulaR1C1 = "(000's)"
With ActiveCell.Characters(Start:=1, Length:=7).Font
.Name = "MS Sans Serif"
.FontStyle = "Bold"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Range("F10:G10").Select
Selection.Copy
Range(Selection, Selection.End(xlToRight)).Select
Range("E10").Select
Application.CutCopyMode = False
Range("G3").Select
Selection.EntireColumn.Insert
Range("H3").Select
Selection.End(xlDown).Select
Range("H10").Select
Selection.Copy
Range("G10").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("H10").Select
Selection.End(xlUp).Select
Selection.End(xlUp).Select
Range("I1").Select
Selection.EntireColumn.Insert
Range("K1").Select
Selection.EntireColumn.Insert
Range("M1").Select
Selection.EntireColumn.Insert
Range("O1").Select
Selection.EntireColumn.Insert
Range("Q1").Select
Selection.EntireColumn.Insert
Range("S1").Select
Selection.EntireColumn.Insert
Range("U1").Select
Selection.EntireColumn.Insert
Range("W1").Select
Selection.EntireColumn.Insert
Range("Y1").Select
Selection.EntireColumn.Insert
Range("AA1").Select
Selection.EntireColumn.Insert
Range("AC1").Select
Selection.EntireColumn.Insert
Range("AE1").Select
Selection.EntireColumn.Insert
Range("AG1").Select
Selection.EntireColumn.Insert
Range("AI1").Select
Selection.EntireColumn.Insert
Range("AK1").Select
Selection.EntireColumn.Insert
ActiveWindow.SmallScroll Down:=-6
Range("F10:G10").Select
Selection.Copy
Range("F10:AT10").Select
Range(Selection, Selection.End(xlToLeft)).Select
Range("F10:AK10").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("F11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("F11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("H11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("H11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("J11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("J11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("L11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("L11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
ActiveWindow.SmallScroll ToRight:=12
Range("N11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("N11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("P11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("P11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("R11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("R11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("T11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("T11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("V11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("V11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("X11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("X11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("Z11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("Z11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
ActiveWindow.SmallScroll ToRight:=11
Range("AB11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("AB11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("AD11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("AD11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("AF11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("AF11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("AH11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("AH11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("AJ11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.TextToColumns Destination:=Range("AJ11"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False,
Other:=True, OtherChar _
:="" & Chr(10) & "", FieldInfo:=Array(Array(1, 1),
Array(2, 1))
Range("G7").Select
ActiveCell.FormulaR1C1 = "10"
Range("G7").Select
Selection.Copy
Range("G7").Select
Application.CutCopyMode = False
Range("G7").Select
Selection.Copy
Range("G11").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
ActiveWindow.SmallScroll ToRight:=4
Range("G11:G65536,I11").Select
Range("I11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range("G11:G65536,I11:I65536,K11").Select
Range("K11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = -22
ActiveWindow.ScrollRow = 1
Range("G11:G65536,I11:I65536,K11:K65536,M11").Select
Range("M11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range
("G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11").Select
Range("O11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range
("G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O65536,Q1
1").Select
Range("Q11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll ToRight:=12
ActiveWindow.ScrollRow = 1
Range
("G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O65536,Q1
1:Q65536,S11"). _
Select
Range("S11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11" _
).Select
Range("U11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11" _
).Select
Range("W11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11" _
).Select
Range("Y11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11:Y65536
,AA11" _
).Select
Range("AA11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11:Y65536
,AA11:AA65536,AC11" _
).Select
Range("AC11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.SmallScroll ToRight:=10
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11:Y65536
,AA11:AA65536,AC11:AC65536,AE11" _
).Select
Range("AE11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11:Y65536
,AA11:AA65536,AC11:AC65536,AE11:AE65536,AG11" _
).Select
Range("AG11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11:Y65536
,AA11:AA65536,AC11:AC65536,AE11:AE65536,AG11:AG65536,AI11"
_
).Select
Range("AI11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Range( _
"G11:G65536,I11:I65536,K11:K65536,M11:M65536,O11:O6
5536,Q11:Q65536,S11:S65536,U11:U65536,W11:W65536,Y11:Y65536
,AA11:AA65536,AC11:AC65536,AE11:AE65536,AG11:AG65536,AI11:A
I65536,AK11" _
).Select
Range("AK11").Activate
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWindow.ScrollRow = 1
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlDivide, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
Range("F11").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.NumberFormat = "0"
Range("F7").Select
ActiveWindow.SmallScroll ToRight:=22
ActiveWindow.SmallScroll Down:=-15
End Sub
 
Chris,

I think it is because you haven't put anything on the clipboard to paste.
Try precdeing that bit of code with

Range("IV255").Value = 10
Range("IV255")..Copy

and afterwards, add

Range("IV255").ClearContents

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top