As I understand it and you're not after VBA, I'd say:
=D9&" "&SheetY!E9 in some relevant cell in X.
Aladin
On sheet X where you need the data;
='Sheet y'!D9 & " and " & 'Sheet y'!E9
The trick is to reference the sheet name with a ! next to the Cell address or Range, like Sheet1! or 'Sheet1'! both work. The concatenation is done by space then "&" space with no quotes around the ampersand. You must add any formatting on your own! If D9=123 and E9=Test then, =D9 & E9 gives 123Test and
=D9 & "and" & E9 gives 123andTest
=D9 & " and " & E9 gives 123 and Test. JSW
I do need it in VBA, to write just a formula was not the problem for me....Can you tell me how to in VBA
No, but some VBA coder will... (NT)
Set MyData= Worksheets("Sheet y").Range("D9") & Worksheets("Sheet y").Range("E9")
MyData.Copy Destination:=Range(Worksheets("Sheet X").Range("A1"").Address)
You can avoid the Sheet tag by using a with statement.
With Worksheets("Sheet y")
your code...
End With
JSW
Hi Celeste, assuming your numeric value (D9) is also in sheet y, your code would be:
ActiveCell.Formula = "='sheet y'!D9&'sheet y'!E9"
Assuming your numeric value (D9) is in sheet X, your code would be:
ActiveCell.Formula = "=D9&'sheet y'!E9"
Both codes will put the formula in the active cell.
Regards,
Barrie