Insert colmn

  • Thread starter Thread starter Yossy
  • Start date Start date
Y

Yossy

how can I automatically insert column before "Column name Top" across
multiple sheet. Also date each column for current month E.g) 1 - Sep -08

all help totally appreciated. thanks
 
Do you want to insert a column before the Column containing "Top" in Row 1,
 
Try
Sub insertCol()
Dim dt As String
dt = Application.WorksheetFunction.Text(Date, "dd-mmm-yyyy")
dt = "01" & Right(dt, Len(dt) - 2)
For Each ws In Worksheets
ws.Activate
Range("1:1").Select
For Each c In Selection
If c.Value = "Top" Then
c.Select
Selection.EntireColumn.Insert
ActiveCell.Value = dt
Exit For
End If
Next
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top