Concanate cells

PANKAJUTEKAR

Board Regular
Joined
Jun 10, 2011
Messages
79
Dear All,

This is very simple but i could not able to recognize "P-" for concanate.

The problem is -

col g have no of tags, say.......pp-1-emu
col b have nothing.
i was trying to concanate col b and col g by following way -
P-pp-1-emu
In above, "P-" in cell b2 and "pp-1-emu" this tag in g2.
This will go till either 55 or 105 or 10 also. as per the requirement.

What i had did -
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim i As Integer, j As Integer ' i=row j=col
Dim k As Integer, l As Integer ' k=row l=col
'Dim a As Integer, b As Integer ' a=row b=col
'a = 2
'b = 27
'l = 2
'k = 2
For i = 2 To 5
If cells(2, 7) <> "" Then
'cells(2, 2) =
Range("b2").Select
ActiveCell.FormulaR1C1 = "=CONCATENATE(P-,RC[5])"
End If
i = i + 1
'k = k + 1
'a = a + 1
Loop
'Do Until i = 5
End Sub

That mean, P- will automatically join to the adjusent cell tag i.e-pp-1-emu

Derfore, all experts, can we have some tacts to solve this?:lookaway:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
ActiveCell.FormulaR1C1 = "=CONCATENATE(""P-"",RC[5])"
 
Upvote 0
Thats it..
?
Sektor Sir,
Shall I keep the rest of the code same?
=====
Bcoz if works only in the case of applying to ane cell. i.e "=concanate formula"
But for all its not work.
Should i need to made any change?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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