• Copy Column Width

    Author
    Topic
    #371734

    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.

    Viewing 1 reply thread
    Author
    Replies
    • #591903

      hello 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 compute

    • #591906

      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

    Viewing 1 reply thread
    Reply To: Copy Column Width

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: