Concatenating a variable.formula and variable.value

[Closed]
Report
-
Posts
17136
Registration date
Sunday June 8, 2008
Status
Contributor
Last seen
October 23, 2021
-
Hello Guys,

I would like to know if there is a way to concatenate a variable.formula and variable.value.
I have written the following lines of code:

sub xyz()

dim x as string
dim y as string

x=Range("A1").Formula
y = Range("A2").Value

Range("A3").Value = x & y

End Sub

Range A1 contains a formula and its value can change according to some other cells. When I am printing the value in A3, its showing the value of "x" as just the formula instead of it curent value when concatenated with the value in A2.

Kindly help me. Thanks in Advance :)

1 reply

Posts
17136
Registration date
Sunday June 8, 2008
Status
Contributor
Last seen
October 23, 2021
5
Please describe :
- the content of A1 and of A2
- what you obtain in A3
- what you expect in A3