Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default Formating Multiple cells

I know there is a better way to do this, but i dont know how.

Sub closerlabel()
ActiveCell.Offset(columnoffset:=3).Select
Selection.Value = "* Closer Reinforcement"
ActiveCell.Offset(0, 2).Select
With ActiveCell
.Interior.ColorIndex = 41
.Font.ColorIndex = 2
End With
ActiveCell.Offset(0, 1).Select
With ActiveCell
.Interior.ColorIndex = 41
.Font.ColorIndex = 2
End With
ActiveCell.Offset(0, 1).Select
With ActiveCell
.Interior.ColorIndex = 41
.Font.ColorIndex = 2
End With
ActiveCell.Offset(rowoffset:=1, columnoffset:=-3).Select
End Sub

thoughts? Thanks.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200706/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Formating Multiple cells

Generally the pros eschew needless selecting.

Sub Alternative()
With ActiveCell
.Offset(0, 3).Value = "* Closer Reinforcement"
With .Offset(0, 5).Resize(1, 3)
.Interior.ColorIndex = 41
.Font.ColorIndex = 2
End With
End With
End Sub


--
Jim
"brownti via OfficeKB.com" <u31540@uwe wrote in message
news:734e08149cb64@uwe...
|I know there is a better way to do this, but i dont know how.
|
| Sub closerlabel()
| ActiveCell.Offset(columnoffset:=3).Select
| Selection.Value = "* Closer Reinforcement"
| ActiveCell.Offset(0, 2).Select
| With ActiveCell
| .Interior.ColorIndex = 41
| .Font.ColorIndex = 2
| End With
| ActiveCell.Offset(0, 1).Select
| With ActiveCell
| .Interior.ColorIndex = 41
| .Font.ColorIndex = 2
| End With
| ActiveCell.Offset(0, 1).Select
| With ActiveCell
| .Interior.ColorIndex = 41
| .Font.ColorIndex = 2
| End With
| ActiveCell.Offset(rowoffset:=1, columnoffset:=-3).Select
| End Sub
|
| thoughts? Thanks.
|
| --
| Message posted via OfficeKB.com
| http://www.officekb.com/Uwe/Forums.a...mming/200706/1
|


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
Multiple conditional formating for one cell tech1NJ Excel Worksheet Functions 2 March 29th 10 05:37 PM
Conditional Formating multiple cells in 1 row based on a list of d Clinton Excel Worksheet Functions 2 November 25th 09 08:03 AM
Formating the same cells in multiple worksheet at the same time? amio1955 Excel Discussion (Misc queries) 3 November 17th 08 05:16 AM
Multiple Conditional Formating Mandeep Dhami Excel Discussion (Misc queries) 8 June 16th 06 06:24 PM
conditional formating cells i Excel based on other cells values Elias Petursson Excel Worksheet Functions 3 May 23rd 06 06:45 PM


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

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

About Us

"It's about Microsoft Excel"