LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 82
Default VBA - Move text in one cell if another cell is not blank

In a worksheet I have some cells that aren't arranged consistently that
contain product information. In most cases the cells are arranged fine, but
there are certain lines that I am having trouble with and I want to
reposition cell contents around.

In the cases I want to effect column A contains a number, in all other cases
that cell is empty. Hoping column A can be used as a "trigger" for the VBA.

Row 1 contains headers, so all this begins on row 2.

Here is the basic logic:

IF A2 is not empty THEN
Move contents of C2 to D2
Move contents of B3 to C2


Example (before):
A | B | C | D |
1 | 1 | Text1 | |
| Text2 | | |
2 | 1 | Text3 | |
| Text4 | | |
3 | 1 | Text5 | |
| Text6 | | |

Example (after):
A | B | C | D |
1 | 1 | Text1 | Text2|
| | | |
2 | 1 | Text3 | Text4 |
| | | |
3 | 1 | Text5 | Text6 |
| | | |

Thanks in advance!

Scott
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hit enter in cell & move text down in cell, not go to cell below. raoul_duke Excel Worksheet Functions 4 April 2nd 23 08:37 PM
Need macro to move to first blank cell in column Joe M. Excel Discussion (Misc queries) 6 December 16th 09 10:22 PM
Remove Civic numbers in Street Address, move to previous blank cell Canuck Excel Worksheet Functions 1 October 12th 06 03:31 PM
move text from form textbox to next blank cell thomas Excel Programming 1 July 26th 05 01:45 AM
Move to next blank cell in column Dominique Feteau[_2_] Excel Programming 6 December 30th 04 03:04 PM


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"