Thank you so much for your help. This worked :)!!
On Nov 10, 11:28=A0am, snoopy...@GMAIL.COM (Joe Matise) wrote:
> You'd need to use a UDF. =A0There are probably 1e8 of these available on =
> quick google search; one example ishttp://www.meadinkent.co.uk/excel-colo=
> Something like
> Function colorofcell(ref as range)
> end function
> put in the VB editor; then you just use
> and it will have the RGB color; for example, "pure" red is 255. =A0Be awa=
> that any function based on color will NOT change until the value itself
> changes in the cell (or the sheet is closed/reopened); just changing the
> color with your mouse will not cause the function to be recalculated. =A0=
> problem if you're not changing things yourself, of course. =A0Then do wha=
> you want with that value - you could just use =3DIF(colorofcell(b2)=3D255=
> for example.
> In fact, all of this of course assumes that you're not the one putting re=
> in the cells... if you are, then do it differently (ie, don't put red in =
> cells, put a value in a column!).
> On Tue, Nov 10, 2009 at 9:43 AM, mike patel <sas...@gmail.com> wrote:
> > Hi Joe,
> > You're right it's a excel file and not CSV. Now when you said create an
> > excel statement to create a variable which will have values 1 or 0 base=
> > the color can you tell me how do we do that?
> > Thanks for replying back!!
> > On Tue, Nov 10, 2009 at 10:27 AM, Joe Matise <snoopy...@gmail.com> wrot=
> >> Can't imagine how a CSV would have color coded records in it. =A0CSV i=
> >> comma separated values, there's no metadata beyond possibly the top li=
> >> headers. =A0Open it in notepad/textpad/etc. and you'll find no colors,=
> >> suspect.
> >> If it's actually an excel file, which would have the ability to have c=
> >> coded rows, you can create an excel statement that will have a 1 or a =
> >> it based on the red/not red, and then use that variable.
> >> -Joe
> >> On Tue, Nov 10, 2009 at 9:00 AM, sassql <sas...@gmail.com> wrote:
> >>> Hi All,
> >>> Hope you all are doing fine. I had a question about reading a raw dat=
> >>> file which is a .csv file & has color coded records in it. So say for
> >>> example I have records 1 through 20 color coded in red & records from
> >>> may be 31 - 35 color coded in blue & so on. Now after I have imported
> >>> this file in SAS I've to create a categorical variable based on the
> >>> color coded records. Is there a way that we can programatically creat=
> >>> this categorical variable just based on the color of the record?
> >>> FYI: The file contains a list of medications that patients where not
> >>> supposed to take during the course of study. So if I somehow cannot
> >>> identify these records based on color I'll have to manually enter the
> >>> name of each drug in a 'If else' statement & then create the
> >>> categorical variable instead.
> >>> Thanks in advance!!- Hide quoted text -
> - Show quoted text -