ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Assigning cell values to variables (https://www.excelbanter.com/excel-discussion-misc-queries/233557-assigning-cell-values-variables.html)

Tim

Assigning cell values to variables
 
I need to take information from various cells and ranges in an Exel
spreadsheet and assign them to variables so that I can combine them into one
statement. So, how do I get the information from the cell various cells or
ranges into the variables? Or is it possible to take information, (string
data and numeric data) from several cells and combine this information into
one statement and have this statement appear in another cell / range of cells?
Can anyone help? Thanks!

T. Valko

Assigning cell values to variables
 
Is this what you had in mind?

A1 = Try
A2 = this
A3 = out

=A1&" "&A2&" "&A3

Returns: Try this out

--
Biff
Microsoft Excel MVP


"Tim" <Tim @discussions.microsoft.com wrote in message
...
I need to take information from various cells and ranges in an Exel
spreadsheet and assign them to variables so that I can combine them into
one
statement. So, how do I get the information from the cell various cells
or
ranges into the variables? Or is it possible to take information,
(string
data and numeric data) from several cells and combine this information
into
one statement and have this statement appear in another cell / range of
cells?
Can anyone help? Thanks!




Jacob Skaria

Assigning cell values to variables
 
Do you mean

A1 = 'Assigning'
B1 = cell
C1 = values

In D1 you need 'Assigning cell values'..If so use CONCATENATE() function or
simply

=A1&B1&C1

If this post helps click Yes
---------------
Jacob Skaria


"Tim" wrote:

I need to take information from various cells and ranges in an Exel
spreadsheet and assign them to variables so that I can combine them into one
statement. So, how do I get the information from the cell various cells or
ranges into the variables? Or is it possible to take information, (string
data and numeric data) from several cells and combine this information into
one statement and have this statement appear in another cell / range of cells?
Can anyone help? Thanks!


Gary''s Student

Assigning cell values to variables
 
Sub tim()
Dim s1 As String, s2 As String
s1 = Range("A1").Value
s2 = Range("Z100").Value
End Sub

--
Gary''s Student - gsnu200856


"Tim" wrote:

I need to take information from various cells and ranges in an Exel
spreadsheet and assign them to variables so that I can combine them into one
statement. So, how do I get the information from the cell various cells or
ranges into the variables? Or is it possible to take information, (string
data and numeric data) from several cells and combine this information into
one statement and have this statement appear in another cell / range of cells?
Can anyone help? Thanks!



All times are GMT +1. The time now is 02:59 PM.

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