ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro won't select columns (https://www.excelbanter.com/excel-discussion-misc-queries/154474-macro-wont-select-columns.html)

Vick

Macro won't select columns
 
I have a macro that I want to select columns A & B, however it appears
because I have Merged cells in rows 1-3 it is selecting A thru P. Does anyone
know a way to prevent this from happening? My code is below.

Columns("A:B").Select
Selection.ColumnWidth = 5

Thanks
Vick

Duke Carey

Macro won't select columns
 
The way to avoid it is DO NOT MERGE CELLS. They are a pox on spreadsheets,
screwing up range selection, sorting, formatting, etc.

Virtually anything you can do with merged cells can be done WITHOUT merging
cells and without screwing up your spreadsheet


"Vick" wrote:

I have a macro that I want to select columns A & B, however it appears
because I have Merged cells in rows 1-3 it is selecting A thru P. Does anyone
know a way to prevent this from happening? My code is below.

Columns("A:B").Select
Selection.ColumnWidth = 5

Thanks
Vick



All times are GMT +1. The time now is 04:12 PM.

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