Solved

Excel code Cell background Colour?

Posted on 2002-05-13
7
208 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
ID: 7006590
Looks okay. What value is mycolour, lngRowCOunt and intCounter? Are those values okay?
0
 
LVL 4

Expert Comment

by:Neutron
ID: 7013096
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
ID: 7013807
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 54

Expert Comment

by:nico5038
ID: 7515092

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
ID: 7527642
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
ID: 7527729
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
ID: 7548156
Question has been closed as per recommendation

JGould-EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
scoreUp challenge 14 57
endX challenge 2 64
VB6 Compile Compatibility Issue 4 90
Adoquery sql  left join does not work 25 80
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

21 Experts available now in Live!

Get 1:1 Help Now