Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 VBA problem with cut and paste range

Status
Not open for further replies.

Llwynog

Technical User
Feb 12, 2004
22
0
0
GB
Hi,
I'm very new to VBA/Macros and I'd appreciate some help with this please.

I've got a spreadsheet with sites and their areas in the same column.
What I'd like to do is to cut the site and paste it to the right of the
first instance of the matching area for that site e.g.
Denver
Yellow
Red
Blue
Green

to get
Yellow Denver
Red Denver
Blu Denver
Green Denver
etc

It is probably very simple, but unfortunately, so am I when it comes to writing code.
Any help would be gratefully receive,kind regards
 
Hi,

Well in your example you have a CITY followed by COLORS and by extension you might in the next row have another city followed by one or more rows each containing a color.

You, me and many others may detect that pattern, but a visitor from some other country having some other language might not! So how would you program logically make that distinction between city and color??? Riddle me THAT!
 
How can you (or the program) distinguish ‘site’ and ‘areas’ if they are in the same column?

If you would have the data in your column like this:[tt]
Denver
Yellow
Red
Blue
Green
Chicago
Blue
Green
Boston
Yellow
Red[/tt]

How would your output look like? And what would be the logic (in plain English) to have this outcome?

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
...and what happens when a city name is the same as a color? Oops!

Your requirement is not very well conceived.
 
Green, OH
Yellow, CA
Alabaster, AL
White, GA
Black, AL
Grey, IA
Golden, CO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top