Concatenate with new entry

Zubair

Active Member
Joined
Jul 4, 2009
Messages
304
Office Version
  1. 2016
Platform
  1. Windows
Hi Experts,

I am trying to apply formula =CONCATENATE($A$1,"/",A1) to bring set of A1&A1 = SS/SS, A1&A2 = SS/TT ......, at the end of row 5, I need to again change $ sign from A1 to A2 & A1. Need 2 actions please,

1. How can I use a single formula to drag down instead of changing a new row with $ so B6 may bring automatically TT/TT.
2. If any new addition in cell A6 and below comes like for example XX, YY same formula should capture in column B


SSSS/SS
TTSS/TT
UUSS/UU
VVSS/VV
WWSS/WW
TT/TT
TT/UU
TT/VV
TT/WW

 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Zubair we have to start some place. I am guessing a formula won't work. It should be a program. Now there is a chance some of the A+ students might weigh in and help out.

VBA Code:
Sub Concat()

Dim LastRw As Integer
Dim cnt As Integer
Dim cnt1 As Integer

Application.ScreenUpdating = False
Range("B:B").ClearContents
LastRw = Cells(Rows.Count, 1).End(xlUp).Row

cnt = 1
cnt1 = 1

For i = 1 To LastRw
cnt1 = i

Do While Cells(cnt1, 1) <> ""

Cells(1, 3) = Cells(i, 1)
Cells(1, 4) = "/"
Cells(1, 5) = Cells(cnt1, 1)

Cells(cnt, 2).Formula = "=concatenate(C1,D1,E1)"

Cells(cnt, 2).Copy
Cells(cnt, 2).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False
cnt = cnt + 1
cnt1 = cnt1 + 1

Loop

Next i

Cells(1, 3).ClearContents
Cells(1, 4).ClearContents
Cells(1, 5).ClearContents
Range("A1").Select
Application.ScreenUpdating = True
End Sub

22-01-30 con ex 1.xlsm
AB
1SSSS/SS
2TTSS/TT
3UUSS/UU
4VVSS/VV
5WWSS/WW
6TT/TT
7TT/UU
8TT/VV
9TT/WW
10UU/UU
11UU/VV
12UU/WW
13VV/VV
14VV/WW
15WW/WW
Data
 
Upvote 0
Solution
Hi Ezguy4u

I have put the above VBA but what formula to put in B1 ?
 
Upvote 0
Hi Ezguy4u

Excellent, yes I run the Macro its working perfectly, very good and many thanks
 
Upvote 0
Zubair, Thank you for the feedback and I am happy to help out.
 
Upvote 0

Forum statistics

Threads
1,214,813
Messages
6,121,706
Members
449,048
Latest member
81jamesacct

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