Solved

Excel code Cell background Colour?

Posted on 2002-05-13
7
206 Views
Last Modified: 2010-04-17
HI All

I am doing bit of code to Output Access query in Excel

I need way to change the colour of Excel cell as I put in data rows... am using code below..it hates it!!!

m_objWorkbook.ActiveSheet.Cells(lngRowCount, intCounter).Interior.ColorIndex = myColour

cheers

George

0
Comment
Question by:Homer1779
7 Comments
 
LVL 22

Expert Comment

by:CJ_S
Comment Utility
Looks okay. What value is mycolour, lngRowCOunt and intCounter? Are those values okay?
0
 
LVL 4

Expert Comment

by:Neutron
Comment Utility
Hi Homer1779, :-)

I don't know much about Excel, but when I need it I usually use a nice trick to record a macro and then look in its source code.

This worked for me:

    With ActiveWorkbook.ActiveSheet.Cells(2, 3).Interior
        .Color = <somecolor>
        .Pattern = xlSolid
    End With

    With ActiveWorkbook.ActiveSheet.Cells(2, 3).Interior
        .ColorIndex = <index>
        .Pattern = xlSolid
    End With

'Don't know if this helps at all but hopefully you can test with your own macros and get what you need.

Greetings,
    </ntr> :)
0
 
LVL 1

Author Comment

by:Homer1779
Comment Utility
Neutron I tried recording macro but mind this is in Excel..... I want to use it from Access that means using Excel references...complete pain!!!
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 54

Expert Comment

by:nico5038
Comment Utility

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - PAQ'd and pts refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
LVL 1

Author Comment

by:Homer1779
Comment Utility
Nic....

I solved this problem in the summer time

Its a pity the kill off question is not there anymore, it just makes the old questions hang about for ages and increases your workload

All the best

George
0
 
LVL 54

Expert Comment

by:nico5038
Comment Utility
Thanks for your reaction George.
Can you post perhaps the solution you found, then others with the same problem might be helped !

Thanks !

Nic;o)
0
 

Accepted Solution

by:
Jgould earned 0 total points
Comment Utility
Question has been closed as per recommendation

JGould-EE Moderator
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
A short article about a problem I had getting the GPS LocationListener working.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now