Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2019, 01:21 PM
DIMI DIMI is offline Replace word Windows 7 32bit Replace word Office 2007
Advanced Beginner
Replace word
 
Join Date: Aug 2017
Posts: 37
DIMI is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 11-23-2019, 10:39 AM
BobBridges's Avatar
BobBridges BobBridges is offline Replace word Windows 7 64bit Replace word Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

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
Not sure what you mean by "save range", and I never print so I'll have to leave you to figure out that part.
Reply With Quote
  #3  
Old 11-23-2019, 12:17 PM
DIMI DIMI is offline Replace word Windows 7 32bit Replace word Office 2007
Advanced Beginner
Replace word
 
Join Date: Aug 2017
Posts: 37
DIMI is on a distinguished road
Default

Quote:
Originally Posted by BobBridges View Post
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
Not sure what you mean by "save range", and I never print so I'll have to leave you to figure out that part.
Thanks
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)"?
Reply With Quote
  #4  
Old 11-24-2019, 10:18 AM
BobBridges's Avatar
BobBridges BobBridges is offline Replace word Windows 7 64bit Replace word Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

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.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace word Need help to replace a word in word file (macro) guwic Word VBA 1 05-13-2019 12:23 AM
Replace word 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
Replace word 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

Other Forums: Access Forums

All times are GMT -7. The time now is 07:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft