ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Joining cell values together (https://www.excelbanter.com/excel-programming/351740-joining-cell-values-together.html)

Danny Boy via OfficeKB.com

Joining cell values together
 
Hi,


I have cell A1 = 10 and B1 = -

This must change A1 to -10

I have no other option, I cannot use any other cells for joining,

Any others Ideas?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1

damorrison

Joining cell values together
 
Want to explain this some more??
Are you saying ,if cell B1 is negative the A1 is negative?


Gary''s Student

Joining cell values together
 
Try this small macro:


Sub Macro1()
Cells(1, 1) = Cells(1, 2) & Cells(1, 1)
End Sub

--
Gary's Student


"Danny Boy via OfficeKB.com" wrote:

Hi,


I have cell A1 = 10 and B1 = -

This must change A1 to -10

I have no other option, I cannot use any other cells for joining,

Any others Ideas?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1


damorrison

Joining cell values together
 
that's pretty cool,
is there a way to do that so you can still keep the formulas in the
cells?
Dave


Gary''s Student

Joining cell values together
 
Hi Dave:

This will work, but only if A1 contains a fomula (starts with =):

Sub Macro2()
Dim s As String
s = Cells(1, 1).Formula
s = "=" & Cells(1, 2) & "(" & Right(s, Len(s) - 1) & ")"
Cells(1, 1).Formula = s
End Sub

--
Gary''s Student


"damorrison" wrote:

that's pretty cool,
is there a way to do that so you can still keep the formulas in the
cells?
Dave



Danny Boy via OfficeKB.com

Joining cell values together
 
Hi Guys

Thanks for your responses

I wish I would have waited for your replies. I did it the way I didn't want
to by going round the bush abit.

I put =A2&B2 into the appriopite cells then copied and pasted the results as
values into column C then went back and deleted the columns A and B, its
works this way and its fast zzzziiiiiiiiiiiiiiipppppppppppp

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200601/1


All times are GMT +1. The time now is 07:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com