#1
|
|||
|
|||
Replace word
Good evening,
I want in sheet1(A1:G50), if client 1 (sheet2(cell(A2)) is german (sheet2(cell(B2)) then select cell(A5) and replace with word 'apple',still select cell(C10) and replace with word 'fruit',if client 2(sheet2(cell(A3)) is italian (sheet2(cell(B3)) then select cell(A5) and replace with word 'orange',still select cell(C10) and replace with word 'vegetable'.Final print and save this range. Could you give an example with code. |
#2
|
||||
|
||||
Here's part of it; I imagine you can adapt it to your own coding style and expand from German to Italian:
Code:
Set owb = ThisWorkbook Set ows1 = owb.Worksheets(1) Set ows2 = owb.Worksheets(2) if ows2.Cells(2, 2).Value = "german" Then ows1.Cells(5, 1).Value = "apple" ows1.Cells(10, 3).Value = "fruit" End If |
#3
|
|||
|
|||
Quote:
Sorry but i am not very good to make vba. Could you finish this macro? If i have a name to sheeets ,i should to change "Worksheets(2)"? |
#4
|
||||
|
||||
It's not your fault (well, it may not be your fault) that you don't know how to write a VBA program, but no, I won't write it for you. What I will do is help you understand how to write it for yourself; then you'll be able to write not only this one but others, too, whenever you need to. If you're interested in learning how, contact me at robhbridges (gmail) and we'll go into this a little at a time, making sure you understand each step so that you'll be able to do it for yourself.
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Need help to replace a word in word file (macro) | guwic | Word VBA | 1 | 05-13-2019 12:23 AM |
Word find and replace | ganesang | Word | 4 | 11-27-2018 12:04 AM |
In Find and Replace, can Word stop after each Replace? | wardw | Word | 1 | 06-08-2017 02:47 PM |
Need help using Find & Replace (MS Word) | BZee | Word | 9 | 02-16-2015 05:45 PM |
find&replace word in uppercase with word in lowercase | andrei | Word | 3 | 10-03-2011 05:11 AM |