Assigning cell values to variables

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

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!
 
Is this what you had in mind?

A1 = Try
A2 = this
A3 = out

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

Returns: Try this out
 
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
 
Sub tim()
Dim s1 As String, s2 As String
s1 = Range("A1").Value
s2 = Range("Z100").Value
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top