VBA Replace

Ezguy4u

Active Member
Joined
Feb 10, 2010
Messages
336
Office Version
  1. 365
Platform
  1. Windows
So I just want to join the letters in column B to the numbers in columns C, D & E. See examples below. I would like to use the VBA code below but the .Value line gives me a list and separator error. It could be the syntax or maybe I am just doing it all wrong. Any help would be appreciated and thank you for your time.
VBA Code:
Sub test3B()

With Range("C1:E2")

.Value = Replace("Range("B1:B2")" & "&@", "@", .Address)

  End With

End Sub

Input
06 Replace Evaluate If rev a.xlsm
BCDE
1A123
2B456
3C789
Count Rows Col workin 1

Output
06 Replace Evaluate If rev a.xlsm
BCDE
1AA1A2A3
2BB4B5B6
3CC7C8C9
Count Rows Col workin 1
 
Peter, the first assumption is accurate, there is no data in column A.
Fair enough. It is just that it is slightly unusual to have a blank column A and we only know what you show and/or tell us, and column A was not shown in your mini-sheets. :)
Anyway, glad you have something that works for you.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

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