View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Resizing columns with a macro

Really? It works now? Hmm, I'm not sure what to tell you about that either;
but I am glad you have it working now (I just wish I understood why your
other code didn't work for you when it worked for the rest of us... I hate
mysteries like this).

--
Rick (MVP - Excel)


"belvy123" wrote in message
...
HJ LATHAM

I input the condensed code you gave me and all is well it works fine now
Crazy man I tell ya

Thanks
--
cruchnin numbers


"Rick Rothstein" wrote:

I'm not sure what to tell you about your "not working" problem... like
JLatham, I get your code to work fine on my system also; with the same
inability to set Column A to exactly 7.51 (this has to do with column
width
needing to be a whole number of pixels wide).

While the following should not do anything to fix your problem, I did
want
to point out to you that there is no need for you to keep selecting
ranges
in order to work on them. Your eleven posted lines of code can be reduced
to
these three lines of code...

Range("a:a").ColumnWidth = 7.51
Range("b:k,o:s").ColumnWidth = 17.57
Range("c:c,e:e,g:g,l:l,n:n").EntireColumn.Hidden = True

--
Rick (MVP - Excel)


"belvy123" wrote in message
...
I am using 2007 at work which is where I am at now and 2003 at home and
have
the samme resluts at each???
very perplexing. I want to fix it but not sure what to do now??
anyone else have any ideas???
--
cruchnin numbers


"JLatham" wrote:

I ran your code in Excel 2003 and it works for me (other than the
oddity
that
column A actually turns out to be 7.57 vs 7.51 wide). I found I
couldn't
set
it to 7.51 manually either.

"belvy123" wrote:

Hi All

I am using the following macro to resize columns as well as hide
several
columns
however there is one column that i want to be a differnet size "7.51
width"
as stated un the macro. But when I run the script it sizes all
columns
the
same 17.57
how is it doing this and what do I need to do to rectify this.
below is the macro

thanks

Columns("a").Select
Selection.ColumnWidth = 7.51
Columns("b:k").Select
Selection.ColumnWidth = 17.57
Columns("o:s").Select
Selection.ColumnWidth = 17.57
Columns("c").Hidden = True
Columns("e").Hidden = True
Columns("g").Hidden = True
Columns("l").Hidden = True
Columns("n").Hidden = True
End Sub
--


Thanks
crunchin numbers