I'm trying to apply this macro to a spreadsheet that I have, but I'm having some issues. I keep getting a run time error. I've attached the file so that you can see what I'm working on.
Thanks for any help that you can lend!
I'm trying to apply this macro to a spreadsheet that I have, but I'm having some issues. I keep getting a run time error. I've attached the file so that you can see what I'm working on.
Thanks for any help that you can lend!
Trosko, you are having the same issue that I faced, your deliminated column "L" has some blanks so the code errors out. I removed the rows with blanks in column L and the macro ran just fine.
So you'll need to update the macro to account for this. I wasn't able to figure that part out and in my case it didn't matter, rows with blanks in the deliminated column were not needed for my project so I was able to just delete those rows by inserting the following code in the macro. You'll notice I put the new code right after the delclarations and before the existing code.
Code:Sub RedistributeData() Dim X As Long, LastRow As Long, A As Range, Table As Range, Data() As String Const Delimiter As String = ", " Const DelimitedColumn As String = "D" Const TableColumns As String = "A:D" Const StartRow As Long = 2 Columns(4).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Last edited by Excel Fox; 08-18-2013 at 08:41 PM. Reason: Code tag added
Things seem to go a little "wonky" when I hit 1179 rows - the macro still separates the rows, but it stops copying the information. Anyone have any idea why that might happen? Thanks!
You can select the range of cells in question and then use ctrl+F and the Replace All function to look for blanks and replace with NULL. Then run the original macro without the code that deletes the blanks.
Bookmarks