ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Assign value to variable (https://www.excelbanter.com/excel-discussion-misc-queries/35018-assign-value-variable.html)

rroach

Assign value to variable
 

Several people have helped me get to the stage where I've got the
following formulae working:

Range("B6").Formula = "=max(h1:h300)"
Range("B7").Formula =
"=(CELL("address",OFFSET(h1,MATCH(MAX(h1:h300),h1: h300,0)-1,0)))"
Range("B8").Formula = "=ROW(OFFSET(A1,COUNTA(A:A)-1,0))"

next question is for my 3 formulae, how do i set a variable to equal
each of those values for writing to a sequential text file?

TIA,

Rob


--
rroach
------------------------------------------------------------------------
rroach's Profile: http://www.excelforum.com/member.php...o&userid=21093
View this thread: http://www.excelforum.com/showthread...hreadid=386677


Rowan

Did you mean assign the three values to one variable like this:

Dim myVar as String
myVar = Range("B6").Value &"," &Range("B7").Value &"," &Range("B8").Value

or assign each value to a different variable like this:

Var1 = Range("B6").Value
Var2 = Range("B7").Value
Var3 = Range("B8").Value

Hope this helps
Rowan

"rroach" wrote:


Several people have helped me get to the stage where I've got the
following formulae working:

Range("B6").Formula = "=max(h1:h300)"
Range("B7").Formula =
"=(CELL("address",OFFSET(h1,MATCH(MAX(h1:h300),h1: h300,0)-1,0)))"
Range("B8").Formula = "=ROW(OFFSET(A1,COUNTA(A:A)-1,0))"

next question is for my 3 formulae, how do i set a variable to equal
each of those values for writing to a sequential text file?

TIA,

Rob


--
rroach
------------------------------------------------------------------------
rroach's Profile: http://www.excelforum.com/member.php...o&userid=21093
View this thread: http://www.excelforum.com/showthread...hreadid=386677




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

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