VBA Question | Insert rows and split cells based on line count in a cell

dutch245

New Member
Joined
Jun 26, 2019
Messages
7
Good morning!

I have a data set that comprises one record per row in excel, however the cells in columns M and N may be one line of data, or may grow into several lines of data.

For the rows that have multiple lines of data in cells M and N I have been manually going in and adding blank rows to equal the number of lines in cells M and N - copying the data from columns A through L into the blank rows, and finally splitting the lines in cells M and N into all of the rows I've inserted.

I have found information online to:

  • Get count of lines in a cell
  • Insert blank rows into my data set

I'm looking to know if anyone knows of a guide, or can provide the VBA code to search my range of data for rows with multiple line cells M and N, insert blank rows as needed, copy cells A thru L into the blank rows, then split M and N accordingly?

Hopefully this post is clear enough to understand, if not please let me know!

Thank you,
 
No need for a temporary variable:
Code:
Sub RenameSheet()    
    
  ActiveSheet.Name = "DJL | " & Replace(Format(Now, "mm.dd"), ":", "|")

  
End Sub
or
Code:
Sub RenameSheet()   
    
  ActiveSheet.Name = Replace(Format(Now, "mm.dd"), ":", "|")
  ActiveSheet.Name = "DJL | " & ActiveSheet.Name
  
End Sub
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

Forum statistics

Threads
1,215,373
Messages
6,124,549
Members
449,170
Latest member
Gkiller

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top