Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting varible to equal values of a # of cells


Is there a way of grabbing the values of a range of cells and assignin
them to a string vairable.

For example if I had RED, BLUE, WHITE in cells A1 to A3 respectively
how could I get my variable strColors=RedBlueWhite

I have tried strColors=Range("A1:A3").value and that obviously did no
work.

Assistance Appreciated

--
mozar
-----------------------------------------------------------------------
mozart's Profile: http://www.excelforum.com/member.php...fo&userid=1331
View this thread: http://www.excelforum.com/showthread.php?threadid=53311

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Setting varible to equal values of a # of cells

Hi Mozart,

I hope this will be music to you ...

Sub RWB()
Dim RWB As String
RWB = Range("A1").Value & Range("A2").Value & Range("A3").Value
End Sub

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting varible to equal values of a # of cells


Yes that would seem the way to do it but it could become painful if say
your range was say 50 cells let alone 62k.

Thanks


--
mozart
------------------------------------------------------------------------
mozart's Profile: http://www.excelforum.com/member.php...o&userid=13314
View this thread: http://www.excelforum.com/showthread...hreadid=533112

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Setting varible to equal values of a # of cells

Sub RWB()
Dim RWB As String
Dim i As Integer
For i = 1 To 50
RWB = RWB & Range("A" & i).Value
Next i
End Sub

All the Best
Carim

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Setting varible to equal values of a # of cells

Would this work for you using the later versions of Excel.
This demo starts at Cell A1 for a size of 50.

Sub Demo()
Dim Str As String
Dim n As Long

n = 50
Str = Join(WorksheetFunction.Transpose(Range("A1").Resiz e(n)),
vbNullString)
End Sub

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"mozart" wrote in
message ...

Yes that would seem the way to do it but it could become painful if say
your range was say 50 cells let alone 62k.

Thanks


--
mozart
------------------------------------------------------------------------
mozart's Profile:
http://www.excelforum.com/member.php...o&userid=13314
View this thread: http://www.excelforum.com/showthread...hreadid=533112





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting varible to equal values of a # of cells


Thanks Dana. That works nicel

--
mozar
-----------------------------------------------------------------------
mozart's Profile: http://www.excelforum.com/member.php...fo&userid=1331
View this thread: http://www.excelforum.com/showthread.php?threadid=53311

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Setting varible to equal values of a # of cells


Hi Mozart,

I hope this will be music to you ...


Sub RWB()
Dim RWB As String
RWB = Range("A1").Value & Range("A2").Value & Range("A3").Value
End Sub


HTH
Cheers
Carim


--
Carim
------------------------------------------------------------------------
Carim's Profile: http://www.excelforum.com/member.php...o&userid=33259
View this thread: http://www.excelforum.com/showthread...hreadid=533112

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: Matching cells across columns, and returning equal values Babymech Excel Discussion (Misc queries) 0 January 26th 09 04:41 PM
setting multiple cells equal to other cells bijoutery Excel Worksheet Functions 2 December 8th 08 03:33 PM
Setting Cells Equal only if Destination Cell Does Not Have a Formu [email protected] Excel Discussion (Misc queries) 2 May 5th 08 05:06 PM
Formula to find equal values with blank cells hilltop55 Excel Discussion (Misc queries) 5 March 22nd 07 09:12 PM
string values do not equal cells, then return msg Kevin O'Neill[_2_] Excel Programming 2 December 14th 05 09:38 PM


All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"