LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Selecting adhoc cells for formatting

Hello,

Could someone please advise on suitable VBA code that enables me to
select multiple cells in a worksheet (cells that are not necessarily
next to each other) so that I can format them in my code given below?

Sub FormatCellRedandWhite()
'
' Format Cell Red and White Macro
' Macro recorded 16/11/2006 by chris.hankin
' This macro will automatically format the cells background to a red
colour, and
' apply a white coloured font setting.

'
ActiveCell.Select

With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 8
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 2
End With

With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With

End Sub

Any help would be greatly appreciated.

Kind regards,

Chris.

Live Long and Prosper :-)

*** Sent via Developersdex http://www.developersdex.com ***
 
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
Selecting & Formatting Columns w/ Merged Cells Lisa Beach New Users to Excel 2 October 10th 05 10:19 PM
Formatting text in a a cell with selecting it. ExcelMonkey[_190_] Excel Programming 1 February 7th 05 09:57 AM
Selecting and formatting cells WylieC Excel Programming 0 October 7th 04 07:45 PM
Selecting cells which do not meet a formatting criteria, and assigning a Range object to these. SuperJas Excel Programming 5 February 23rd 04 03:36 AM
Copying Formatting Without Selecting Dan Gesshel Excel Programming 0 August 20th 03 01:12 AM


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

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"