Simple Macro

Discuss all aspects of programming here.

Moderator: The Mod Squad

Simple Macro

Postby SkReaP » Wed Oct 12, 2005 9:52 am

Let me establish some things that will help prevent back and forth posts of this nature:

"did you try xxxxx?"
"do you know how to xxxxx?"
"yes, tried that already"
"try this: xxxxx"
"already did. along with xxxxx"
"ok, then this is what you need: xxxxx"

VB through Excel (.xls format, not .csv)

W2k3 Pro (latest service pack)

Public comp @ Work. Downloads & links will not work. Please post code.

I'm extrememly fluent with VB, just not the Excel specific commands

Now that that's out of the way, are my two very simple questions:
1 - Given an alphabetized list of unknown length, how do I compare each cell to the next and delete duplicates? All of the information is in column A, so I just need to compare row X to row X+1 until row X+1 is empty.

2 - If I have strings that look like Company_Software_UniqueID_Version, how do I copy JUST the UniqueID & Version number over to another cell? The UniqueID can be 5-7 numbers long, and the version isn't always a number. Also, if the company or software has more than one word in it, underscores will be used instead of spaces.

If these are in cells A1 & A2 respectively, how to I make cells B1 & B2 contain 1234567_00 & 12345_02c respectively?

Please answer as quickly as you can. If you're like me and are constantly crunched for time and can't write out a full macro for me, then just post a function - I'm experienced enough with programming that I can probably figure out how to use it.
Brown Belt
Brown Belt
Posts: 266
Joined: Wed Feb 11, 2004 3:01 pm
Location: Anyplace with internet

Postby SkReaP » Wed Oct 12, 2005 11:59 am

...ok - surely SOMEONE knows how to write a loop in Visual Basic!

Why so quiet guys? I really need to know this.
Brown Belt
Brown Belt
Posts: 266
Joined: Wed Feb 11, 2004 3:01 pm
Location: Anyplace with internet

Postby Tulatin » Wed Oct 12, 2005 12:02 pm

*tap* *tap* *Whisper*

Moved to Programming, S'okay though, been a while since you've been in, and you woudln't know about the normal sections
Enlightened Master
Enlightened Master
Posts: 14664
Joined: Wed Dec 11, 2002 2:29 pm
Location: Canada

Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests