ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy Row Heights (https://www.excelbanter.com/excel-discussion-misc-queries/225241-copy-row-heights.html)

Arun

Copy Row Heights
 
I would like to copy the row heights from one worksheet to another, but none
of the other formatting (I realize I can copy-paste special an entire row and
get the row height to change, but I can't have the rest of the formatting
copy with it). Is there any reason that the paste-special dialog box has a
'column width' selection but not a selection for 'row height'???

Gord Dibben

Copy Row Heights
 
Select the rows to copy and paste to sheet2.

EditClearAll

Data and formatting is gone but row heights remain.

Why there is no "row height" in paste special is not known by anyone but the
developers.


Gord Dibben MS Excel MVP




On Mon, 23 Mar 2009 13:08:26 -0700, Arun
wrote:

I would like to copy the row heights from one worksheet to another, but none
of the other formatting (I realize I can copy-paste special an entire row and
get the row height to change, but I can't have the rest of the formatting
copy with it). Is there any reason that the paste-special dialog box has a
'column width' selection but not a selection for 'row height'???



Arun

Copy Row Heights
 
I am actually pasting not to a blank sheet, but a sheet with it's own data
and formatting that I want to keep. The section I want to adjust the row
heights on is identical to that of the first sheet except for a number of
conditional formats and cell colors that I want to retain.

"Gord Dibben" wrote:

Select the rows to copy and paste to sheet2.

EditClearAll

Data and formatting is gone but row heights remain.

Why there is no "row height" in paste special is not known by anyone but the
developers.


Gord Dibben MS Excel MVP




On Mon, 23 Mar 2009 13:08:26 -0700, Arun
wrote:

I would like to copy the row heights from one worksheet to another, but none
of the other formatting (I realize I can copy-paste special an entire row and
get the row height to change, but I can't have the rest of the formatting
copy with it). Is there any reason that the paste-special dialog box has a
'column width' selection but not a selection for 'row height'???




Dave Peterson

Copy Row Heights
 
Is a macro ok?

If yes:

Option Explicit
Sub testme()

Dim iRow As Long
Dim FromWks As Worksheet
Dim ToWks As Worksheet

Set FromWks = Worksheets("Sheet1")
Set ToWks = Worksheets("Sheet2")

For iRow = 3 To 19
ToWks.Rows(iRow).RowHeight = FromWks.Rows(iRow).RowHeight
Next iRow

End Sub

I assumed that the row numbers of each range match up on both sheets.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Arun wrote:

I am actually pasting not to a blank sheet, but a sheet with it's own data
and formatting that I want to keep. The section I want to adjust the row
heights on is identical to that of the first sheet except for a number of
conditional formats and cell colors that I want to retain.

"Gord Dibben" wrote:

Select the rows to copy and paste to sheet2.

EditClearAll

Data and formatting is gone but row heights remain.

Why there is no "row height" in paste special is not known by anyone but the
developers.


Gord Dibben MS Excel MVP




On Mon, 23 Mar 2009 13:08:26 -0700, Arun
wrote:

I would like to copy the row heights from one worksheet to another, but none
of the other formatting (I realize I can copy-paste special an entire row and
get the row height to change, but I can't have the rest of the formatting
copy with it). Is there any reason that the paste-special dialog box has a
'column width' selection but not a selection for 'row height'???




--

Dave Peterson

Dave Peterson

Copy Row Heights
 
And I also assumed you wanted to use rows 3:19.

Dave Peterson wrote:

Is a macro ok?

If yes:

Option Explicit
Sub testme()

Dim iRow As Long
Dim FromWks As Worksheet
Dim ToWks As Worksheet

Set FromWks = Worksheets("Sheet1")
Set ToWks = Worksheets("Sheet2")

For iRow = 3 To 19
ToWks.Rows(iRow).RowHeight = FromWks.Rows(iRow).RowHeight
Next iRow

End Sub

I assumed that the row numbers of each range match up on both sheets.

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Arun wrote:

I am actually pasting not to a blank sheet, but a sheet with it's own data
and formatting that I want to keep. The section I want to adjust the row
heights on is identical to that of the first sheet except for a number of
conditional formats and cell colors that I want to retain.

"Gord Dibben" wrote:

Select the rows to copy and paste to sheet2.

EditClearAll

Data and formatting is gone but row heights remain.

Why there is no "row height" in paste special is not known by anyone but the
developers.


Gord Dibben MS Excel MVP




On Mon, 23 Mar 2009 13:08:26 -0700, Arun
wrote:

I would like to copy the row heights from one worksheet to another, but none
of the other formatting (I realize I can copy-paste special an entire row and
get the row height to change, but I can't have the rest of the formatting
copy with it). Is there any reason that the paste-special dialog box has a
'column width' selection but not a selection for 'row height'???



--

Dave Peterson


--

Dave Peterson


All times are GMT +1. The time now is 06:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com