LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Text to Rows

Hi, I am newbie in excel Macros. I have a macro that works well if used on a
cell. BUT if I want to run it on every cell within a Range, I get an error -
"Invalid, Next control Variable reference". Please help. see below

Sub NewOne()
Dim x As Integer
Dim y As Integer

' Hardcoded range A1 to C2
NumRows = Range("A1", "A2").Rows.Count
NumCols = Range("A1", "C1").Cols.Count

Range("A1").Select

For x = 1 To NumRows Step 1
For y = 1 To NumCols Step 1
'Text to multiple rows
'-------------
SrcData = Cells(x, y).Value
OutPutData = Split(SrcData, ";")
'OutPutData = Split(SrcData, Chr(10))

For SplitData = 0 To UBound(OutPutData)
Range("J" & SplitData + 1) = OutPutData(SplitData)
'Cells(SplitData + 1, "a") = OutPutData(SplitData)
'-------------
Next y
Next x

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
find text and copy selected rows from text and loop bluewatermist Excel Programming 3 November 17th 09 06:09 AM
Text to Rows and then Insert Blank Rows [email protected] Excel Discussion (Misc queries) 1 December 20th 08 04:23 PM
Delete rows with numeric values, leave rows with text GSpline Excel Programming 5 October 11th 05 12:44 AM
delete empty rows between rows with text Paulo Baptista Excel Discussion (Misc queries) 2 February 28th 05 03:41 PM
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' Dan E[_2_] Excel Programming 4 July 30th 03 06:43 PM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"