number1+ number2

  • Thread starter Thread starter Himszy
  • Start date Start date
H

Himszy

Hi

I want to add two numbers together but not as in 2 + 2 = 4 but 22. Whats the
code I write?

Thanks Michael
 
=2&2 gives 22

or =B1&C1 if the numbers were in cells B1 and C1

Regards

Trevor
 
Himszy said:
Hi

I want to add two numbers together but not as in 2 + 2 = 4 but 22. Whats the
code I write?

Thanks Michael

Doesn't matter just worked it out
 
=2 & 2

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Such as:

Public Function AddAsString(ByRef v1 As Variant, ByRef v2 As Variant) As
Variant
AddAsString = CStr(v1) & CStr(v2)
End Function

So that in your cell you call the function
AddAsString(2, 2)

?
 
Sub test()
With ActiveSheet.Range("K4")
.Value = 2 & 2
.NumberFormat = 0
End With
End Sub

Gord Dibben Excel MVP
 
I think you can use:
CONCATENATE (text1,text2,...)
Text1, text2, ... are 1 to 30 text items to be joined into a single text
item. The text items can be text strings, numbers, or single-cell
references.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top