Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default setting Bold

In the macro below I have tried to make the following line bold along with
the colour but I kept getiing errors. What is the proper way of doing it?

ship.EntireRow.Font.ColorIndex = 1

I would also like to make the macro work automatically whenever the
worksheet is opened.

Thanks
Frank.





Sub macro1()
Dim ship As Range
For Each ship In Worksheets("shipped").Range("ak3",
Range("ak3").End(xlDown))
If ship = "1" Then 'yesterday
ship.EntireRow.Font.ColorIndex = 3
ElseIf ship = "0" Then 'today
ship.EntireRow.Font.ColorIndex = 1
Else: ship.EntireRow.Font.ColorIndex = 10 'tomorrow
End If
Next ship
End Sub





  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default setting Bold

Assume Ship is a reference to a range

With ship.EntireRow.Font
.ColorIndex = 1
.bold = True
End With


Put it in the workbook_Open Event
see Chip Pearson's page on events
http://www.cpearson.com/excel/events.htm


--
Regards,
Tom Ogilvy


"FJ Shepley & JM Pfohl" wrote in message
...
In the macro below I have tried to make the following line bold along with
the colour but I kept getiing errors. What is the proper way of doing it?

ship.EntireRow.Font.ColorIndex = 1

I would also like to make the macro work automatically whenever the
worksheet is opened.

Thanks
Frank.





Sub macro1()
Dim ship As Range
For Each ship In Worksheets("shipped").Range("ak3",
Range("ak3").End(xlDown))
If ship = "1" Then 'yesterday
ship.EntireRow.Font.ColorIndex = 3
ElseIf ship = "0" Then 'today
ship.EntireRow.Font.ColorIndex = 1
Else: ship.EntireRow.Font.ColorIndex = 10 'tomorrow
End If
Next ship
End Sub







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
Printing in excel always comes out in bold even tho bold not on Scarlett50 Excel Discussion (Misc queries) 2 March 26th 10 02:39 PM
Alphabetically list of last names: BOLD, not bold Lerner Excel Discussion (Misc queries) 16 March 1st 09 07:46 PM
Alphabetically list of names BOLD and NOT bold Lerner Excel Discussion (Misc queries) 13 March 1st 09 02:37 PM
Join bold and non-bold text in one cell bkincaid Excel Discussion (Misc queries) 3 March 21st 06 12:58 AM
Sending email via macro- setting the importance setting. Julian Milano[_2_] Excel Programming 1 January 20th 04 10:15 PM


All times are GMT +1. The time now is 05:05 PM.

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"