PC Review


Reply
Thread Tools Rate Thread

Catcher in the Rye

 
 
moneyball.wilson@gmail.com
Guest
Posts: n/a
 
      31st Jul 2007
Hello,

I am new at programming in excel and thought I might turn here for
some help.

I am trying to code a macro to help me with a problem that I have.

My worksheet looks like this

[Condition Code] [ Condition]
Red
Green
Blue
Purple

I am trying to write some code in visual basic that says "If the cell
in condition column equals a given color (i.e. Red) then place the
condition code (i.e A4) in the condition code column.

I have many records so scrolling through and entering manually will
take much time.

Can anyone provide assitance? Please let me know if I can be more
specific.

Sincerely,
Rambo

 
Reply With Quote
 
 
 
 
ADK
Guest
Posts: n/a
 
      31st Jul 2007
What about conditional formatting?

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I am new at programming in excel and thought I might turn here for
> some help.
>
> I am trying to code a macro to help me with a problem that I have.
>
> My worksheet looks like this
>
> [Condition Code] [ Condition]
> Red
> Green
> Blue
> Purple
>
> I am trying to write some code in visual basic that says "If the cell
> in condition column equals a given color (i.e. Red) then place the
> condition code (i.e A4) in the condition code column.
>
> I have many records so scrolling through and entering manually will
> take much time.
>
> Can anyone provide assitance? Please let me know if I can be more
> specific.
>
> Sincerely,
> Rambo
>



 
Reply With Quote
 
ADK
Guest
Posts: n/a
 
      31st Jul 2007
Conditional Formatting:
http://www.cpearson.com/excel/cformatting.htm

Conditional in Code (more than 3 conditions):
http://www.vbaexpress.com/kb/getarticle.php?kb_id=90


"ADK" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What about conditional formatting?
>
> <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hello,
>>
>> I am new at programming in excel and thought I might turn here for
>> some help.
>>
>> I am trying to code a macro to help me with a problem that I have.
>>
>> My worksheet looks like this
>>
>> [Condition Code] [ Condition]
>> Red
>> Green
>> Blue
>> Purple
>>
>> I am trying to write some code in visual basic that says "If the cell
>> in condition column equals a given color (i.e. Red) then place the
>> condition code (i.e A4) in the condition code column.
>>
>> I have many records so scrolling through and entering manually will
>> take much time.
>>
>> Can anyone provide assitance? Please let me know if I can be more
>> specific.
>>
>> Sincerely,
>> Rambo
>>

>
>



 
Reply With Quote
 
moneyball.wilson@gmail.com
Guest
Posts: n/a
 
      31st Jul 2007
On Jul 31, 12:39 pm, "ADK" <A...@noreply2today.com> wrote:
> Conditional Formatting:http://www.cpearson.com/excel/cformatting.htm
>
> Conditional in Code (more than 3 conditions):http://www.vbaexpress.com/kb/getarticle.php?kb_id=90
>
> "ADK" <A...@noreply2today.com> wrote in message
>
> news:(E-Mail Removed)...
>
>
>
> > What about conditional formatting?

>
> > <moneyball.wil...@gmail.com> wrote in message
> >news:(E-Mail Removed)...
> >> Hello,

>
> >> I am new at programming in excel and thought I might turn here for
> >> some help.

>
> >> I am trying to code a macro to help me with a problem that I have.

>
> >> My worksheet looks like this

>
> >> [Condition Code] [ Condition]
> >> Red
> >> Green
> >> Blue
> >> Purple

>
> >> I am trying to write some code in visual basic that says "If the cell
> >> in condition column equals a given color (i.e. Red) then place the
> >> condition code (i.e A4) in the condition code column.

>
> >> I have many records so scrolling through and entering manually will
> >> take much time.

>
> >> Can anyone provide assitance? Please let me know if I can be more
> >> specific.

>
> >> Sincerely,
> >> Rambo- Hide quoted text -

>
> - Show quoted text -


Thank you very much for the suggestion, but as far as I can tell
conditional formatting will not allow me to add a value to a different
column only change the formatting of the column.

 
Reply With Quote
 
=?Utf-8?B?cXVpZXRsZWUyMDIx?=
Guest
Posts: n/a
 
      31st Jul 2007
Try this in a spreadsheet - keep column A open, add your values of Red,
Green, Blue, Purple to column B - insert a new code module and then paste
this in:

Sub ColorMyWorld()
Dim sRange As String
Dim sACol As String, sBCol As String
Dim i As Integer
Dim sCell As String

sBCol = "B"
sACol = "A"

For i = 1 To 4
sRange = sBCol & i
Range(sRange).Select
sCell = Range(sRange).Value
Select Case sCell
Case "Red"
Range(sACol & i).Value = "A4"
Case "Green"
Range(sACol & i).Value = "A3"
Case "Blue"
Range(sACol & i).Value = "A2"
Case "Purple"
Range(sACol & i).Value = "A1"
End Select
Next
End Sub

This should get you started - you of course need to add a routine that would
figure out the last row for the For Next statement...

"(E-Mail Removed)" wrote:

> On Jul 31, 12:39 pm, "ADK" <A...@noreply2today.com> wrote:
> > Conditional Formatting:http://www.cpearson.com/excel/cformatting.htm
> >
> > Conditional in Code (more than 3 conditions):http://www.vbaexpress.com/kb/getarticle.php?kb_id=90
> >
> > "ADK" <A...@noreply2today.com> wrote in message
> >
> > news:(E-Mail Removed)...
> >
> >
> >
> > > What about conditional formatting?

> >
> > > <moneyball.wil...@gmail.com> wrote in message
> > >news:(E-Mail Removed)...
> > >> Hello,

> >
> > >> I am new at programming in excel and thought I might turn here for
> > >> some help.

> >
> > >> I am trying to code a macro to help me with a problem that I have.

> >
> > >> My worksheet looks like this

> >
> > >> [Condition Code] [ Condition]
> > >> Red
> > >> Green
> > >> Blue
> > >> Purple

> >
> > >> I am trying to write some code in visual basic that says "If the cell
> > >> in condition column equals a given color (i.e. Red) then place the
> > >> condition code (i.e A4) in the condition code column.

> >
> > >> I have many records so scrolling through and entering manually will
> > >> take much time.

> >
> > >> Can anyone provide assitance? Please let me know if I can be more
> > >> specific.

> >
> > >> Sincerely,
> > >> Rambo- Hide quoted text -

> >
> > - Show quoted text -

>
> Thank you very much for the suggestion, but as far as I can tell
> conditional formatting will not allow me to add a value to a different
> column only change the formatting of the column.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
runtime error catcher associates Microsoft Excel Discussion 2 9th Jun 2006 06:26 AM
Spam Catcher Lady Veteran Microsoft Outlook 1 2nd Oct 2005 05:28 PM
DNS Catcher. Luis Renato Comim Jr. Security Signatures 2 8th Aug 2005 02:37 AM
Avast + Spy Catcher? William W. Plummer Anti-Virus 1 9th Apr 2004 05:23 PM
Re: url catcher/launcher? offen Freeware 0 15th Aug 2003 10:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:02 PM.