#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 87
Default Copying Formats

I know how to use the paste special / format command for things like fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5 rows
have had their heights changed in various ways. I need to continue this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have heights like
the first 5 rows.

Any easy way to do this?


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copying Formats

Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) + 1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things like fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5 rows
have had their heights changed in various ways. I need to continue this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have heights like
the first 5 rows.

Any easy way to do this?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 87
Default Copying Formats

I know just enough about macros to get in trouble, so I'll try this on an
experimental sheet first. Attach this to a button, maybe, and click to my
heart's content?


"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) + 1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5 rows
have had their heights changed in various ways. I need to continue this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have heights
like
the first 5 rows.

Any easy way to do this?


--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copying Formats

Yep. Remember to use a button from the Forms toolbar and to save before you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this on an
experimental sheet first. Attach this to a button, maybe, and click to my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) + 1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5 rows
have had their heights changed in various ways. I need to continue this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have heights
like
the first 5 rows.

Any easy way to do this?


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 87
Default Copying Formats

Thanks, Dave. One more question: Let's say I want the macro to look at the
first 5 rows, duplicated them (which your code apparently does already),
*BUT* I want it to skip a row before doing its thing? In other words, look
at rows 1 through 5, skip row 6, and duplicate onto rows 6 through 11? Can
you provide the extra whatever for that?

And, where do I send the virtual beer? :-)


"Dave Peterson" wrote in message
...
Yep. Remember to use a button from the Forms toolbar and to save before
you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this on an
experimental sheet first. Attach this to a button, maybe, and click to my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5
rows
have had their heights changed in various ways. I need to continue
this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have heights
like
the first 5 rows.

Any easy way to do this?

--

Dave Peterson


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copying Formats

I don't understand what skip row 6 means and yet the rowheights are duplicated
on 6-11 (6 rows, not 5).

Maybe you could give an example--something like:

1-5 "master" row height
6 skipped
7-11 based on 1-5
12 skipped
13-17 based on 1-5

Or whatever the rules are.



JoeSpareBedroom wrote:

Thanks, Dave. One more question: Let's say I want the macro to look at the
first 5 rows, duplicated them (which your code apparently does already),
*BUT* I want it to skip a row before doing its thing? In other words, look
at rows 1 through 5, skip row 6, and duplicate onto rows 6 through 11? Can
you provide the extra whatever for that?

And, where do I send the virtual beer? :-)

"Dave Peterson" wrote in message
...
Yep. Remember to use a button from the Forms toolbar and to save before
you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this on an
experimental sheet first. Attach this to a button, maybe, and click to my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5
rows
have had their heights changed in various ways. I need to continue
this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have heights
like
the first 5 rows.

Any easy way to do this?

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 87
Default Copying Formats

Sorry Dave. Posting when too fatigued. Put blank row at 6. Then, 7-11 match
1-5, and so on.



"Dave Peterson" wrote in message
...
I don't understand what skip row 6 means and yet the rowheights are
duplicated
on 6-11 (6 rows, not 5).

Maybe you could give an example--something like:

1-5 "master" row height
6 skipped
7-11 based on 1-5
12 skipped
13-17 based on 1-5

Or whatever the rules are.



JoeSpareBedroom wrote:

Thanks, Dave. One more question: Let's say I want the macro to look at
the
first 5 rows, duplicated them (which your code apparently does already),
*BUT* I want it to skip a row before doing its thing? In other words,
look
at rows 1 through 5, skip row 6, and duplicate onto rows 6 through 11?
Can
you provide the extra whatever for that?

And, where do I send the virtual beer? :-)

"Dave Peterson" wrote in message
...
Yep. Remember to use a button from the Forms toolbar and to save
before
you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this on
an
experimental sheet first. Attach this to a button, maybe, and click to
my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's
intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things
like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5
rows
have had their heights changed in various ways. I need to continue
this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have
heights
like
the first 5 rows.

Any easy way to do this?

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copying Formats

So all these groups use 1-5 as the basis for the rowheight:
7-11
12-16
17-21

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 7 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 2) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub



JoeSpareBedroom wrote:

Sorry Dave. Posting when too fatigued. Put blank row at 6. Then, 7-11 match
1-5, and so on.

"Dave Peterson" wrote in message
...
I don't understand what skip row 6 means and yet the rowheights are
duplicated
on 6-11 (6 rows, not 5).

Maybe you could give an example--something like:

1-5 "master" row height
6 skipped
7-11 based on 1-5
12 skipped
13-17 based on 1-5

Or whatever the rules are.



JoeSpareBedroom wrote:

Thanks, Dave. One more question: Let's say I want the macro to look at
the
first 5 rows, duplicated them (which your code apparently does already),
*BUT* I want it to skip a row before doing its thing? In other words,
look
at rows 1 through 5, skip row 6, and duplicate onto rows 6 through 11?
Can
you provide the extra whatever for that?

And, where do I send the virtual beer? :-)

"Dave Peterson" wrote in message
...
Yep. Remember to use a button from the Forms toolbar and to save
before
you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this on
an
experimental sheet first. Attach this to a button, maybe, and click to
my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's
intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things
like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5
rows
have had their heights changed in various ways. I need to continue
this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have
heights
like
the first 5 rows.

Any easy way to do this?

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Copying Formats

Watch the line wrap:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 7 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 2) Mod 5) + 1).RowHeight
Next iRow
End With
End Sub


Dave Peterson wrote:

So all these groups use 1-5 as the basis for the rowheight:
7-11
12-16
17-21

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 7 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 2) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

JoeSpareBedroom wrote:

Sorry Dave. Posting when too fatigued. Put blank row at 6. Then, 7-11 match
1-5, and so on.

"Dave Peterson" wrote in message
...
I don't understand what skip row 6 means and yet the rowheights are
duplicated
on 6-11 (6 rows, not 5).

Maybe you could give an example--something like:

1-5 "master" row height
6 skipped
7-11 based on 1-5
12 skipped
13-17 based on 1-5

Or whatever the rules are.



JoeSpareBedroom wrote:

Thanks, Dave. One more question: Let's say I want the macro to look at
the
first 5 rows, duplicated them (which your code apparently does already),
*BUT* I want it to skip a row before doing its thing? In other words,
look
at rows 1 through 5, skip row 6, and duplicate onto rows 6 through 11?
Can
you provide the extra whatever for that?

And, where do I send the virtual beer? :-)

"Dave Peterson" wrote in message
...
Yep. Remember to use a button from the Forms toolbar and to save
before
you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this on
an
experimental sheet first. Attach this to a button, maybe, and click to
my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's
intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things
like
fonts,
alignment, number formats, etc. But, I've got a sheet whose first 5
rows
have had their heights changed in various ways. I need to continue
this
formatting down the page. (Row 1 height =20, Row 2 height = 40, for
instance). In other words, each batch of 5 rows needs to have
heights
like
the first 5 rows.

Any easy way to do this?

--

Dave Peterson

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 87
Default Copying Formats

Thanks, Dave. I'll play with this tonight when the phones finally shut up.

"Dave Peterson" wrote in message
...
So all these groups use 1-5 as the basis for the rowheight:
7-11
12-16
17-21

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 7 To .Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 2) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub



JoeSpareBedroom wrote:

Sorry Dave. Posting when too fatigued. Put blank row at 6. Then, 7-11
match
1-5, and so on.

"Dave Peterson" wrote in message
...
I don't understand what skip row 6 means and yet the rowheights are
duplicated
on 6-11 (6 rows, not 5).

Maybe you could give an example--something like:

1-5 "master" row height
6 skipped
7-11 based on 1-5
12 skipped
13-17 based on 1-5

Or whatever the rules are.



JoeSpareBedroom wrote:

Thanks, Dave. One more question: Let's say I want the macro to look at
the
first 5 rows, duplicated them (which your code apparently does
already),
*BUT* I want it to skip a row before doing its thing? In other words,
look
at rows 1 through 5, skip row 6, and duplicate onto rows 6 through 11?
Can
you provide the extra whatever for that?

And, where do I send the virtual beer? :-)

"Dave Peterson" wrote in message
...
Yep. Remember to use a button from the Forms toolbar and to save
before
you try
it--or use a test worksheet.

JoeSpareBedroom wrote:

I know just enough about macros to get in trouble, so I'll try this
on
an
experimental sheet first. Attach this to a button, maybe, and click
to
my
heart's content?

"Dave Peterson" wrote in message
...
Just the rowheights?

You could use a macro:

Option Explicit
Sub testme()
Dim iRow As Long
With Worksheets("sheet1")
For iRow = 6 To
.Cells.SpecialCells(xlCellTypeLastCell).Row
.Rows(iRow).RowHeight = .Rows(((iRow - 1) Mod 5) +
1).RowHeight
Next iRow
End With
End Sub

If you're new to macros, you may want to read David McRitchie's
intro
at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

JoeSpareBedroom wrote:

I know how to use the paste special / format command for things
like
fonts,
alignment, number formats, etc. But, I've got a sheet whose
first 5
rows
have had their heights changed in various ways. I need to
continue
this
formatting down the page. (Row 1 height =20, Row 2 height = 40,
for
instance). In other words, each batch of 5 rows needs to have
heights
like
the first 5 rows.

Any easy way to do this?

--

Dave Peterson

--

Dave Peterson

--

Dave Peterson


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying formats - column widths, formats, outlining to worksheets DavidBr318 Excel Worksheet Functions 4 August 14th 09 05:03 AM
automatic copying of formats sethe Excel Discussion (Misc queries) 1 October 4th 06 02:24 PM
Copying all formats from worksheet to worksheet Gary Excel Worksheet Functions 1 January 11th 06 05:18 PM
copying excel chart formats from one chart to another [email protected] Excel Discussion (Misc queries) 0 August 31st 05 02:18 PM
copying conditional formats to a whole column Markitos Excel Worksheet Functions 0 November 1st 04 11:23 PM


All times are GMT +1. The time now is 11:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"