Styles and row height

MrDB4Excel

Active Member
Joined
Jan 29, 2004
Messages
348
Office Version
  1. 2013
Platform
  1. Windows
Is it possible to create an excel style to force row height?
In the spreadsheet I am working on I use a row height of 8 and a specific color to separate specific data sets.
When I begin to input the next data set I skip a row to input data in subsequent rows.
Then I go back and adjust the height of the skipped row and assign the color I use for this separator.
OR
Maybe there is a specific method to create separators as I have described, possibly with a macro?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
You should be able to create a macro to do what you want via the macro recorder.
 
Upvote 0
Will not work because the macro records the exact row, but I need to run this same macro on any given selected row and it will only run it again on the row selected during macro recording.
 
Upvote 0
If, for example, you get from the macro recorder :
Code:
Rows("6:6").Select
Selection.RowHeight = 8
Change it to this :
Code:
Selection.RowHeight = 8
 
Upvote 0
Hello footoo,
Now I need to figure out how to pause the macro so I can select 5 column cells in the same row. After making the above-captioned change it sets the row height to 8, but only infills color to one cell.
The recorded macro included to set the background color of the selection. The following is what I have so far:

Sub DataSeparator()
'
' DataSeparator Macro
' Row height 8 and light green color
'

'
Selection.RowHeight = 8
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 13434777
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.RowHeight = 8
End Sub
 
Upvote 0
Hello footoo,
Now I need to figure out how to pause the macro so I can select 5 column cells in the same row. After making the above-captioned change it sets the row height to 8, but only infills color to one cell.
The recorded macro included to set the background color of the selection. The following is what I have so far:

Sub DataSeparator()
'
' DataSeparator Macro
' Row height 8 and light green color
'

'
Selection.RowHeight = 8
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 13434777
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.RowHeight = 8
End Sub
 
Upvote 0
Hello footoo,
Now I need to figure out how to pause the macro so I can select 5 column cells in the same row. After making the above-captioned change it sets the row height to 8, but only infills color to one cell.
The recorded macro included to set the background color of the selection. The following is what I have so far:

Sub DataSeparator()
'
' DataSeparator Macro
' Row height 8 and light green color
'

'
Selection.RowHeight = 8
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 13434777
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Selection.RowHeight = 8
End Sub
 
Upvote 0
If you select the 5 cells in the row then run the macro, the code you posted will do what you want.

If you only want to select 1 cell in the row, then after selecting the cell :
Code:
Sub DataSeparator()
If Selection.Rows.Count > 1 Then
    MsgBox "Select cell(s) only in the appropriate row."
    Exit Sub
End If
Selection.RowHeight = 8
With Intersect(Selection.EntireRow, [A:E]).Interior
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    .Color = 13434777
    .TintAndShade = 0
    .PatternTintAndShade = 0
End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,160
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top