Set a Range to a variable
On Tuesday, February 12, 2013 5:32:21 PM UTC-8, Howard wrote:
I am trying to set a group of four cell to three variables.
Dim sec1 As String (tried Value, Range and Variant also)
Dim sec2 As String
Dim sec3 As String
sec1 = Range("B3:E3").String (tried Value, Range and Variant also)
sec2 = Range("G3:J3").String
sec3 = Range("L3:O3").String
MsgBox sec1 & sec2 & sec3
The above produces every type miss match error available in Excel in the process.
When successful with that I then want to Randamize them something like
=Rand(sec1&" "&sec2&" "&sec3) back into three sets of four cells else where on the sheet.
Thanks,
Howard
GS,
My wife came out of the back room wondering what I was whooping about...
One more quick question if I may.
sec1 = Range("$B$3:$E$3") Column F blank
sec2 = Range("$G$3:$J$3") Column K blank
sec3 = Range("$L$3:$O$3")
Are there a few characters in the code I could change to leave column F and K blank in the 6 by 12 table to do a 6 by 14 table. Did not occur to me in my original post. Sorry.
If it requires a full re-write I'd say forget it, I can live with this an be a happy camper.
Howard
|