dazza Posted June 20, 2011 Share Posted June 20, 2011 Dear Boffins, Is there anyway of getting a cell colour in a spreadsheet? The excel udfs only cover the basic. I hope so; I don't want to resort to VBAing the result--I'd like to keep everything AutoIT. Ta Link to comment Share on other sites More sharing options...
MrMitchell Posted June 20, 2011 Share Posted June 20, 2011 One way is with the single cell selected, run:$color = $oExcel.Selection.Interior.ColorIndexI found a color table here.For instance if my cell was highlighted yellow it would return a 6.Sorry but I'm not sure if this is already built in to release UDFs or not Link to comment Share on other sites More sharing options...
dazza Posted June 21, 2011 Author Share Posted June 21, 2011 Hmm. You have me perplexed MrMitchell... $color = $headcount_excel.Selection.Interior.ColorIndex This returns a value of 19. But... 1) The excel udfs do not cover this function (it matters not mind) 2) How do I select a specific cell? If 2) can be answered then I'm a happy bunny. Many thanks Link to comment Share on other sites More sharing options...
Mat Posted June 21, 2011 Share Posted June 21, 2011 (edited) Hmm. You have me perplexed MrMitchell... $color = $headcount_excel.Selection.Interior.ColorIndex This returns a value of 19. But... 1) The excel udfs do not cover this function (it matters not mind) 2) How do I select a specific cell? If 2) can be answered then I'm a happy bunny. Many thanks Sorry for rewriting this post: This works in excel macros: Range("F14").Interior.ColorIndex = 6 Edit: This lets you use rgb: Range("F14").Interior.Color = RGB(0, 0, 255) Edited June 21, 2011 by Mat AutoIt Project Listing Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now