ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert column (https://www.excelbanter.com/excel-programming/332533-insert-column.html)

Italian Pete

Insert column
 

From the top (headings) row, I want to check each row until I find the
heading "telephone" at which point I want to insert a column to the right.

How does one do this in a macro?

many thanks,
Pete

Tom Ogilvy

Insert column
 
Dim res as Variant
res = application.Match("telephone",rows(1),0)
if not iserror(res) then
columns(res+1).Insert
End if

--
Regards,
Tom Ogilvy

"Italian Pete" wrote in message
...

From the top (headings) row, I want to check each row until I find the
heading "telephone" at which point I want to insert a column to the right.

How does one do this in a macro?

many thanks,
Pete





All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com