Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I would like to create a macro that set the columns width for my Excel form. It must probably look like what's quoted at the end of this message. The problem is that it is a macro that is active permenently on the page when you edit the cells. I want a macro that set the width on demand. Any ideas? Thx! Werner Private Sub Worksheet_Change(ByVal Target As Excel.Range) Select Case Target.Column Case 1, 3, 5 To 8 Target.ColumnWidth = 2 Case 2, 4 Target.ColumnWidth = 7 End Select End Sub -- Message posted via http://www.officekb.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello, Jean-Jerome. You can record this macro as long as your columns won't
be moving around. http://www.officearticles.com/excel/...soft_excel.htm ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Jean-Jerome Doucet via OfficeKB.com" wrote in message ... Hi, I would like to create a macro that set the columns width for my Excel form. It must probably look like what's quoted at the end of this message. The problem is that it is a macro that is active permenently on the page when you edit the cells. I want a macro that set the width on demand. Any ideas? Thx! Werner Private Sub Worksheet_Change(ByVal Target As Excel.Range) Select Case Target.Column Case 1, 3, 5 To 8 Target.ColumnWidth = 2 Case 2, 4 Target.ColumnWidth = 7 End Select End Sub -- Message posted via http://www.officekb.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub SetColumns()
Dim i as Long for i = 1 to 8 Select Case i Case 1, 3, 5 To 8 columns(i).ColumnWidth = 2 Case 2, 4 columns(i).ColumnWidth = 7 End Select Next End Sub -- Regards, Tom Ogilvy "Jean-Jerome Doucet via OfficeKB.com" wrote in message ... Hi, I would like to create a macro that set the columns width for my Excel form. It must probably look like what's quoted at the end of this message. The problem is that it is a macro that is active permenently on the page when you edit the cells. I want a macro that set the width on demand. Any ideas? Thx! Werner Private Sub Worksheet_Change(ByVal Target As Excel.Range) Select Case Target.Column Case 1, 3, 5 To 8 Target.ColumnWidth = 2 Case 2, 4 Target.ColumnWidth = 7 End Select End Sub -- Message posted via http://www.officekb.com |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you to both of you. It wolved my problem.
Jean-Jérôme -- Message posted via http://www.officekb.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to keep specific name colomns and delete all others | Excel Discussion (Misc queries) | |||
Delete colomns and rows | Excel Worksheet Functions | |||
colomns got swoeched | New Users to Excel | |||
re-name colomns i.e A,B,C, etc | Excel Discussion (Misc queries) | |||
how to merge 2 colomns | Excel Worksheet Functions |