Every 2nd row bold, how to? 
Author Message
 Every 2nd row bold, how to?

Hi!

I want to create a macro, which makes every 2nd row of a selected
area in bold and/or with grey background.
How I can do this?

Thanks for Your help
Regards
Juergen



Mon, 19 Feb 2001 03:00:00 GMT  
 Every 2nd row bold, how to?
Hello Juergen,

Try either of these:

Sub EveryOtherShaded()
For c = Selection.Row To Selection.Count - 1 Step 2
Rows(c).EntireRow.Interior.ColorIndex = 15
Next c
End Sub

Sub EveryOtherBold()
For c = Selection.Row To Selection.Count - 1 Step 2
Rows(c).EntireRow.Font.Bold = True
Next c
End Sub

Good luck

http://www.xydata.com

Quote:

>Hi!

>I want to create a macro, which makes every 2nd row of a selected
>area in bold and/or with grey background.
>How I can do this?

>Thanks for Your help
>Regards
>Juergen



Mon, 19 Feb 2001 03:00:00 GMT  
 Every 2nd row bold, how to?
Sorry Juergen,

Correction:

Sub EveryOtherShaded()
For c = Selection.Row To Selection.Row + Selection.Count - 1 Step 2
Rows(c).EntireRow.Interior.ColorIndex = 15
Next c
End Sub

Sub EveryOtherBold()
For c = Selection.Row To Selection.Row + Selection.Count - 1 Step 2
Rows(c).EntireRow.Font.Bold = True
Next c
End Sub

Quote:

>Hello Juergen,

>Try either of these:

>Sub EveryOtherShaded()
>For c = Selection.Row To Selection.Count - 1 Step 2
>Rows(c).EntireRow.Interior.ColorIndex = 15
>Next c
>End Sub

>Sub EveryOtherBold()
>For c = Selection.Row To Selection.Count - 1 Step 2
>Rows(c).EntireRow.Font.Bold = True
>Next c
>End Sub

>Good luck

>http://www.xydata.com


>>Hi!

>>I want to create a macro, which makes every 2nd row of a selected
>>area in bold and/or with grey background.
>>How I can do this?

>>Thanks for Your help
>>Regards
>>Juergen



Mon, 19 Feb 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dynamic Sum (of every 2nd row) on Range Resize

2. Delete every 2nd and 3rd row- VBA

3. Deleting every 2nd and 3rd row

4. Getting #deleted message in every field of every row when linking to a SQL Server DB

5. Hide rows with zero value and shade/fill every other VISIBLE row

6. group every 8 rows in 1 row

7. Comparison of each row with every other row in a spreadsheet and elimination of duplicates

8. Deleting several rows every nth row

9. macro to insert new row every other row

10. group every 8 rows in 1 row


 
Powered by phpBB® Forum Software © phpBB Group