Combine Text and Integers to single cell?

Kriskros07

New Member
Joined
Sep 1, 2011
Messages
11
Hi,

The following bit of VBA (.Formula line specifically) only works for numerical cell content. When trying to concatenate a text field with a numerical one and output results to a single cell its not happy. Any ideas of how to do this. Is there a .Text type statement i could use perhaps instead?

With Range(Cells(1, g + 1), Cells(LR, g + 1))
.Formula = "=" & Cells(1, g - 2) & Cells(LR, g)
.Value = .Value
End With

Any help greatly appreciated as usual :o)
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How about?

Code:
.Formula = "=" & Cells(1, g - 2).Value & "&" & Cells(LR, g).Value

or simply:

Code:
.Value = Cells(1, g - 2).Value & Cells(LR, g).Value
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,181
Members
452,893
Latest member
denay

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