Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Easley, South Carolina, USA
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy Column Width

    Is there a quick and easy way to copy column width and row height to a new sheet or
    file? I know that one can do a SAVE AS and then delete data to make a template, but
    I am interesting in copying formatting in a more direct way.

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Copy Column Width

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> thomascox

    OK how about if you copy the whole column, then clear the cell contents?

    Is that direct enough for your purposes?

    IMHO I suggest you write a VBA macro that you place in your Personal.xls for all of these neat things that you need to do.

    If you need any examples, there is a great thread called Personal.xls Tutorial. Search for it and READ IT.

    Wassim <img src=/S/compute.gif border=0 alt=compute width=40 height=20>
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Copy Column Width

    For me, quickest and easiest would be to use the little Format Painter paintbrush from the toolbar (if it's not on your toolbar, drag it from View, Toolbars, Customize, Commands, Format). Next would be to Copy, Paste Special, Formats. If you need to restrict it to only Height and Width with no other formats copied, code would look like:

    Dim dblW As Double, dblH As Double

    Sub GetWH() ' gets the settings
    With Selection.Cells
    dblW = .ColumnWidth
    dblH = .RowHeight
    End With
    End Sub

    Sub PutWH() 'puts the settings, with no protection if the GET code wasn't run
    With Selection.Cells
    .ColumnWidth = dblW
    .RowHeight = dblH
    End With
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •