Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 7th, 2013, 05:51 PM
Registered User
 
Join Date: Feb 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question vba conditional formatting

I am working on a spreadsheet that requires 480 cells with conditional formatting that is all the same conditions. I've written a macro to insert eh conditions in each cell, but the cell reference gets entered as "Q31" instead of Q31.

Can someone help me get rid of the quotes?

Here is the code

Dim rCell As Range
Dim sCell As String
Set rCell = ActiveCell.Offset(-1, 0)
sCell = rCell.Address(False, False)
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreater, _
Formula1:=sCell
Selection.FormatConditions(Selection.FormatConditi ons.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
.Color = -16752384
.TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 13561798
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False


Thanks!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional formatting r05579 SharePoint Development 0 February 19th, 2010 12:08 PM
conditional formatting jeremy1048 Access 4 July 3rd, 2008 11:20 AM
Conditional formatting vemaju Excel VBA 2 June 6th, 2007 04:41 AM
Conditional Formatting on Subform echovue Access 4 March 3rd, 2006 03:25 AM
Conditional Formatting Corey Access 1 November 8th, 2005 12:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.