Blackie50
06-07-2011, 03:49 AM
Hi
I am running the following code (after creating a pivot table) in 2003 (and again in 2010)
For Each cel1 In Range(Cells(5, 1), Cells(Rows.Count, 1).End(xlUp))
If cel1.Offset(, 1).Value > 0 Then
cel1.Offset(, 4) = Split(cel1, " ")(0)
cel1.Offset(, 7) = Split(cel1, " ")(1)
This takes row 5 col A entry (e.g) CMFC and splits it to
CMF in row 5 col E
C in row 5 col H
works perfectly in 2003 but get the following in 2010
puts CMFC in row 5 col E (ie does not split)
and then bugs out next row
runtime error '9'
subscript out of range
Any ideas why it won't work in 2010?
many thanks
Jon
I am running the following code (after creating a pivot table) in 2003 (and again in 2010)
For Each cel1 In Range(Cells(5, 1), Cells(Rows.Count, 1).End(xlUp))
If cel1.Offset(, 1).Value > 0 Then
cel1.Offset(, 4) = Split(cel1, " ")(0)
cel1.Offset(, 7) = Split(cel1, " ")(1)
This takes row 5 col A entry (e.g) CMFC and splits it to
CMF in row 5 col E
C in row 5 col H
works perfectly in 2003 but get the following in 2010
puts CMFC in row 5 col E (ie does not split)
and then bugs out next row
runtime error '9'
subscript out of range
Any ideas why it won't work in 2010?
many thanks
Jon