View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Autofit column Help?

Hi Tim,

If you use the code from my second post then you must copy it into
ThisWorkbook module; not the Sheet module.

Also you must delete my other code from the Sheet modules.

In case you don't understand what I mean then when you are in the VBA
Editor, on the left hand side there is a column (Window) that is called the
Project Explorer with a list of the modules. (If you can't see this Window
then Select menu item View - Project Explorer.) In this window you will see
a list of the Sheet modules and also one called ThisWorkbook. Double Click
ThisWorkbook and copy the code from my second post into it.

Double click each of the other sheet modules in turn and delete my other
code from them. (You cannot have any subs called Private Sub
Worksheet_Change(ByVal Target As Range) in the individual sheet modules.)

I have tested the code in my second post and it works on whatever is the
active sheet.

Hope this helps.

--
Regards,

OssieMac