Get the contents of column A and put it in Column B overwiting a tag

allencunningham

New Member
Joined
Feb 16, 2019
Messages
10
I am working with just 2 columns. I am writing a macro to get the value from column A
and put it in column B, overwriting the tag style, so that row 1 appears like the following:

The Regency Straight Back is a traditional .....,
and do this for all rows

Column A | Column B |
Regency Straight Back | The style is a traditional .... |
Modern Alba | This style is our latest ...... |
Classical Wide back | Our new style is finally available ... |
 
Re: Get the value from one column and put in another column

Hi Allen,

try without omitting the optional arguments in Find Parameters:

Code:
Sub ReplaceXXX()
    
    Dim i As Integer
    Dim LastRow As Integer
    
    LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
    
    For i = 1 To LastRow
        
        Range("B" & i).Replace What:="XXX", Replacement:=Range("A" & i).Value, LookAt:=xlPart, SearchOrder:=xlByColumns, MatchCase:=False, _
    SearchFormat:=False, ReplaceFormat:=False
        
        
    Next
    
End Sub

If it still doesn't work, please publish an example of the text you have in column A and column B
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Re: Get the value from one column and put in another column

Hi Sequoyah - Actually the first one worked fine when I tried it again. Even though the 'XXX' occurred multiple times and was buried inside hundreds of words of html text, it was able to do the replace for every occurrence.

Thanks

Allen
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top