Is it possible to catch ColumnResize (or RowResize) Event in

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Colo

MrExcel MVP,
Joined
Mar 20, 2002
Messages
1,456
Hi pmdown,

Excel does not have rows/columns resize event.
So, to catch event, you need to make an original event...(I think :biggrin:)

Please look into SetWindowLong, CallWindowProc and how to subclass.

Subclass is
One of the techniques for acquiring the message from Windows which cannot be
acquired usually.

Sorry I cannot explain it in detail in English.... Maybe Juan or Ivan knows... :biggrin:

And, here is the url of sample code for std module(Japanese page, but you can see code)
http://www.remus.dti.ne.jp/~shenron/access/knowhow/samples/stdSubClass.txt
 

pmdown

Board Regular
Joined
May 6, 2002
Messages
71
Hi Colo.

I suppose, that using API, will be only way to do this, but it's for me too difficult...

Thanx
 

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810
Tell us the context; why you need to know when a resize event is occurring.

Tell us the chain of events that you expect the user to perform, at what point you want the resize event to trigger, and what you plan to do afterwards.

If you can share your plan, we can share our expertise.
 

pmdown

Board Regular
Joined
May 6, 2002
Messages
71

ADVERTISEMENT

Hi Steve.
Thank's for interest in my Question.

I create in Excel a Form for entering data. Because of Printing and next processing, the Form can be only one page high and one page width.

But users stil can entering, deleting or resizing columns (rows). For this reason i need, by each this event check if isn't exceed the page width ( page length ).

Entering columns can I catch with "WorksheetChange Event", but column resizing - i don't now...

Best regards
pmdown
 

pmdown

Board Regular
Joined
May 6, 2002
Messages
71
...I forget: I don't wont and I can't use the "Adjust to 1 page horizontaly and 1 page verticaly" function in page setup...
 

stevebausch

Well-known Member
Joined
May 11, 2002
Messages
810
Well,you could tally up the .columnwidths, and compare against an acceptable value. You could do that in BeforePrint. If there is a problem, set cancel to true, msgbox user, tell them to adjust columns and try again.

You could protect the sheet against column adjustments. Perhaps you WANT the users to have that freedom, I think that's wonderful on your part, going out of your way to allow it. I understand (from other threads) that locking/protecting a worksheet is confusing to some. So I won't say any more about the topic.

Or, if the issue is really because the protection options of Excel 97 are getting in your way, you could leave the protection as it is, and just explicitly assign the .columnwidths in the Workbook_BeforePrint routine.

Let them play all they want, just assign columnwidths to the correct values immediately before printing.
This message was edited by stevebausch on 2002-10-14 09:46
 

Forum statistics

Threads
1,143,923
Messages
5,721,557
Members
422,370
Latest member
A Nonomus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top