Solved

Excel code Cell background Colour?

Posted on 2002-05-13
7
209 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This is an explanation of a simple data model to help parse a JSON feed
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
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…

822 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