|
|
|
date: Fri, 7 Mar 2008 17:51:00 -0800,
group: microsoft.public.word.vba.beginners
back
Excel 2003 - Writing a Macro - How Do I...?
I'm trying to write a macro that will loop down a column and find identical
numbers, then check the values in the offset cells 3 columns away, decide
which value should be kept, and then delete the rows containing the unneeded
values. In other words, if I have 4 rows with the following number in column
C:
8475727
And the value in column F for these four rows is a possibility of :
EARTH
AIR
FIRE
WATER
ICE
STEAM
I want the macro to keep the rown containing "EARTH" if it's available and
delete the other rows. However, if "EARTH" is NOT available, I want it to
pick "AIR" and delete the rest. If "AIR"'s not available, I want it to pick
"FIRE", and so on.
Any insight into how this could be accomplished would be sweet. I'm fairly
new at VBA Programming, and this one is beyond me.
Thanks!
date: Fri, 7 Mar 2008 17:51:00 -0800
author: Alton
Re: Excel 2003 - Writing a Macro - How Do I...?
You should ask this in an Excel group - this one is for Word.
--
Enjoy,
Tony
"Alton" wrote in message
news:B2D295F4-2C35-4895-B696-57207A2EB824@microsoft.com...
> I'm trying to write a macro that will loop down a column and find
> identical
> numbers, then check the values in the offset cells 3 columns away, decide
> which value should be kept, and then delete the rows containing the
> unneeded
> values. In other words, if I have 4 rows with the following number in
> column
> C:
>
> 8475727
>
> And the value in column F for these four rows is a possibility of :
>
> EARTH
> AIR
> FIRE
> WATER
> ICE
> STEAM
>
> I want the macro to keep the rown containing "EARTH" if it's available and
> delete the other rows. However, if "EARTH" is NOT available, I want it to
> pick "AIR" and delete the rest. If "AIR"'s not available, I want it to
> pick
> "FIRE", and so on.
>
> Any insight into how this could be accomplished would be sweet. I'm
> fairly
> new at VBA Programming, and this one is beyond me.
>
> Thanks!
date: Sat, 8 Mar 2008 18:00:25 -0000
author: Tony Jollans My forename at my surname dot com
Re: Excel 2003 - Writing a Macro - How Do I...?
Regretfully, you won't find much here because this newsgroup is for VBA in Word,
not Excel. They're both VBA, but the tools used are very different.
Try reposting in the excel.programming group,
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.excel.programming.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all
may benefit.
On Fri, 7 Mar 2008 17:51:00 -0800, Alton
wrote:
>I'm trying to write a macro that will loop down a column and find identical
>numbers, then check the values in the offset cells 3 columns away, decide
>which value should be kept, and then delete the rows containing the unneeded
>values. In other words, if I have 4 rows with the following number in column
>C:
>
>8475727
>
>And the value in column F for these four rows is a possibility of :
>
>EARTH
>AIR
>FIRE
>WATER
>ICE
>STEAM
>
>I want the macro to keep the rown containing "EARTH" if it's available and
>delete the other rows. However, if "EARTH" is NOT available, I want it to
>pick "AIR" and delete the rest. If "AIR"'s not available, I want it to pick
>"FIRE", and so on.
>
>Any insight into how this could be accomplished would be sweet. I'm fairly
>new at VBA Programming, and this one is beyond me.
>
>Thanks!
date: Sat, 08 Mar 2008 13:42:10 -0500
author: Jay Freedman
|
|