Insert Blank row at change in a given Column

  • Thread starter Thread starter Karthik
  • Start date Start date
K

Karthik

Hi All,

I would like to create a macro to insert a blank rows at every change
in a column. I also want to give the input box option to select the
column.

Thanks for the help!!

Regards,

Karthik
 
Sub addcol()

ColmLetter = InputBox("Enter column Letter : ")

Lastrow = Cells(Rows.Count, ColmLetter).End(xlUp).Row
For RowCount = Lastrow To 2 Step -1
If Range(ColmLetter & RowCount) <> _
Range(ColmLetter & (RowCount - 1)) Then

Rows(RowCount).Insert
End If
Next RowCount

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