Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find text and copy selected rows from text and loop | Excel Programming | |||
Text to Rows and then Insert Blank Rows | Excel Discussion (Misc queries) | |||
Delete rows with numeric values, leave rows with text | Excel Programming | |||
delete empty rows between rows with text | Excel Discussion (Misc queries) | |||
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' | Excel Programming |