If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Need help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-11, 00:20
lauzy lauzy is offline
Registered User
 
Join Date: Jun 2011
Posts: 1
Need help

Hi all. I would like to use VBA to check a column of values (Column A) for a value (Papaya) and replace a common value(Fruit) in another column which contains values already at the same row. Thanks.

From:
Item Type
Papaya Vegetable
Chilli Vegetable
Papaya Vegetable
Cabbage Vegetable
Potato Vegetable
Cabbage Vegetable

To:
Item Type
Papaya Fruit
Chilli Vegetable
Papaya Fruit
Cabbage Vegetable
Potato Vegetable
Cabbage Vegetable
Reply With Quote
  #2 (permalink)  
Old 06-11-11, 11:02
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Hi,

Turn on the macro recorder and then record yourself performing these steps manually:
  • Select column A
  • CTRL+F
  • Replace Tab
  • Find What: Papaya Vegetable
  • Replace With: Papaya Fruit
  • Replace All
  • Close
Then it's just a case of reviewing the code that the macro recorder has generated and tidying it up a little.

Let us know how you get on....
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On