473,320 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Convert Cell Colour in excel in RGB component

1
I have all my data in an excell sheet and I what to transfer it to ACAD.
I need a function, macro that extracts the colour of a cell in excel and gives me back three RGB values in another cell. I can then use that cell for input in ACAD.
Jan 9 '07 #1
1 2131
Killer42
8,435 Expert 8TB
I have all my data in an excell sheet and I what to transfer it to ACAD.
I need a function, macro that extracts the colour of a cell in excel and gives me back three RGB values in another cell. I can then use that cell for input in ACAD.
Try this...
Expand|Select|Wrap|Line Numbers
  1. Private Static Sub SplitColour(ByVal Colour As Long, Red As Long, Green As Long, Blue As Long)
  2.  
  3.   Dim Temp As Long
  4.   Blue = Colour \ &H10000
  5.   Temp = Blue * &H10000
  6.   Colour = Colour - Temp
  7.  
  8.   Green = Colour \ &H100
  9.   Temp = Green * &H100
  10.   Colour = Colour - Temp
  11.  
  12.   Red = Colour
  13.  
  14. End Sub
(I had to add the Temp variable to get around some weird results.)
Jan 9 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Lois | last post by:
My website formatting knowledge is mostly HTML; I know hardly any Javascript. Recently I created a site with a nav bar in table format across the top of the page, and I made the background colour...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
3
by: Shilpa | last post by:
Hi, I want to read excel data cell by cell using C#. I do not want to use a connection and say "select * from Sheet1" I do not want to use the COM Excel 11 library. I do not want to create an...
16
by: alexia.bee | last post by:
Hi all, In some weird reason, excel instance won;t die if i remove the comment from 4 lines of setting values into struct. here is a snipcode public...
0
by: Badino | last post by:
Hi, Can someone tell me what to put in this code so that if a user selects 0 (Black) then make the font white (0) as my default colour is black on my Excel spreadsheet. Private Type...
1
by: nanaalwi | last post by:
Hi all, I'm doing a software using vb.net that related to excel. The software that i implement requires filling the color inside the cells. Previously, the source code that I used is: ...
2
by: Ch Pravin | last post by:
Hi All: I am having the following xml which i need to convert to excel using xslt. Please help me out. Afghanistan.xml <?xml version="1.0" encoding="utf-16"?> <Languages...
2
by: patrick.waldo | last post by:
Hi all, I am trying to figure out a way to read colors with xlrd, but I did not understand the formatting.py module. Basically, I want to sort rows that are red or green. My initial attempt...
3
Frinavale
by: Frinavale | last post by:
Hi there, I'm using JavaScript to highlight a row or column in a table. I have created a CSS class that changes the background colour to a light blue and I apply this class to the cells in the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.