ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Displaying the value of a string (https://www.excelbanter.com/excel-programming/415424-displaying-value-string.html)

Risky Dave

Displaying the value of a string
 
Hi,

I am not a programmer, so apologies if I don't use the correct terms here -
hope it makes sense!

I have a piece of code that uses a string (Dim Storage As String)to store
text concatenated from a series of cells.

What I now want to do is display the concatenated text in a single cell.

I have tried to use:

Range("A1").Value = Storage

But this doesn't actually display the text held in Storage in cell A1. When
I select the cell, it remains blank, but the Formula bar shows that correct
value is associated with the cell.

Any suggestions on how I move the text value of Storage into A1?

This is in Office 2007 under Vista, if that's of any importance.

TIA

Dave

Gary Keramidas

Displaying the value of a string
 
this works for me

Option Explicit
Sub test()
Dim Storage As String

Storage = Range("b2").Value & Range("c2").Value & Range("d2").Value & _
Range("e2").Value
Range("a1").Value = Storage

End Sub

--


Gary


"Risky Dave" wrote in message
...
Hi,

I am not a programmer, so apologies if I don't use the correct terms here -
hope it makes sense!

I have a piece of code that uses a string (Dim Storage As String)to store
text concatenated from a series of cells.

What I now want to do is display the concatenated text in a single cell.

I have tried to use:

Range("A1").Value = Storage

But this doesn't actually display the text held in Storage in cell A1. When
I select the cell, it remains blank, but the Formula bar shows that correct
value is associated with the cell.

Any suggestions on how I move the text value of Storage into A1?

This is in Office 2007 under Vista, if that's of any importance.

TIA

Dave




Risky Dave

Displaying the value of a string - SOLVED!
 
Gary,

Thanks for the prompt respone. Just realised I was being stupid.

The output cell was actually merged with loads of others and the value was
being displayed at the bottom off the cell - below the bottom of the screen!

"Gary Keramidas" wrote:

this works for me

Option Explicit
Sub test()
Dim Storage As String

Storage = Range("b2").Value & Range("c2").Value & Range("d2").Value & _
Range("e2").Value
Range("a1").Value = Storage

End Sub

--


Gary


"Risky Dave" wrote in message
...
Hi,

I am not a programmer, so apologies if I don't use the correct terms here -
hope it makes sense!

I have a piece of code that uses a string (Dim Storage As String)to store
text concatenated from a series of cells.

What I now want to do is display the concatenated text in a single cell.

I have tried to use:

Range("A1").Value = Storage

But this doesn't actually display the text held in Storage in cell A1. When
I select the cell, it remains blank, but the Formula bar shows that correct
value is associated with the cell.

Any suggestions on how I move the text value of Storage into A1?

This is in Office 2007 under Vista, if that's of any importance.

TIA

Dave






All times are GMT +1. The time now is 01:38 PM.

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