Hi,
Could anyone assist with some VBA which would add a Column to the beginning of a sheet, (Column A) and Populate the rows of new column with the first 8 characters of the sheet name. The file contains over 100 sheets, and we only require the first 8 characters of the sheet name to be added to the new row. The new row should only be populated for as many rows as which already contains data.
Any help appreciated, I've found this code online, however it populates with the entire sheet name. Ideally the sheet names would also only begin to fill from Cell A3 not A1.
Any help much appreciated.![]()
Option Explicit Sub Prepare_Sheet() Dim WS As Worksheet Dim LASTROW As Long For Each WS In Sheets With WS LASTROW = .Range("A" & Rows.Count).End(xlUp).Row .Columns(1).Insert .Range("A1:A" & LASTROW) = WS.Name End With Next WS End Sub
Thanks
Daniel
Bookmarks