ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   batch editing a document (https://www.excelbanter.com/excel-programming/410759-batch-editing-document.html)

shem

batch editing a document
 
does anyone know how to bold a document on alternate lines? for example if i
have 10 lines, and i want the odd number lines batch bolded while even
numbers remain the same, is there a formula i can use in either word or
excel? any help or idea would be appreciated?

Gary''s Student

batch editing a document
 
Sub boldit()
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
For i = 1 To nLastRow Step 2
Cells(i, 1).EntireRow.Font.Bold = True
Next
End Sub
--
Gary''s Student - gsnu200785

Shane Devenshire

batch editing a document
 
Hi,

You can do this without VBA by using conditional formatting. Assuming you
are using 2003 or earlier this would do it:

1. Select the range you want formatted.
2. Choose Format, Conditional Formatting
3. From the first drop down choose Formula is
4. In the next box enter =MOD(ROW(),2)
5. Click the Format button and on the Font tab choose Bold (or whatever)

The above formula bolds all Odd numbered rows, to do Even numbered rows use
=MOD(ROW(),2)=0

In 2007:
1. Select the range
2. Choose Home, Conditional Formatting, New Rule
3. Choose Use a formula to determine which cell to format
4. In the Format values where this formula is true box enter the same
formulas as above
5. Click the Format button and on the Font tab choose Bold (or whatever)


Cheers,
Shane Devenshire
Microsoft Excel MVP

"shem" wrote in message
...
does anyone know how to bold a document on alternate lines? for example if
i
have 10 lines, and i want the odd number lines batch bolded while even
numbers remain the same, is there a formula i can use in either word or
excel? any help or idea would be appreciated?



Gord Dibben

batch editing a document
 
Adding to Shane's suggestion.

=MOD(SUBTOTAL(3,$A1:$A$2),2)=0

Will survive filtering while the =MOD(ROW(),2) will not.


Gord Dibben MS Excel MVP

On Sun, 11 May 2008 08:02:35 -0700, "Shane Devenshire"
wrote:

Hi,

You can do this without VBA by using conditional formatting. Assuming you
are using 2003 or earlier this would do it:

1. Select the range you want formatted.
2. Choose Format, Conditional Formatting
3. From the first drop down choose Formula is
4. In the next box enter =MOD(ROW(),2)
5. Click the Format button and on the Font tab choose Bold (or whatever)

The above formula bolds all Odd numbered rows, to do Even numbered rows use
=MOD(ROW(),2)=0

In 2007:
1. Select the range
2. Choose Home, Conditional Formatting, New Rule
3. Choose Use a formula to determine which cell to format
4. In the Format values where this formula is true box enter the same
formulas as above
5. Click the Format button and on the Font tab choose Bold (or whatever)


Cheers,
Shane Devenshire
Microsoft Excel MVP

"shem" wrote in message
...
does anyone know how to bold a document on alternate lines? for example if
i
have 10 lines, and i want the odd number lines batch bolded while even
numbers remain the same, is there a formula i can use in either word or
excel? any help or idea would be appreciated?




All times are GMT +1. The time now is 01:31 AM.

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