?
Solved

Excel code Cell background Colour?

Posted on 2002-05-13
7
Medium Priority
?
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Progress
Suggested Courses

752 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