+ Reply to Thread
Results 1 to 2 of 2

Assign value to variable

  1. #1
    Registered User
    Join Date
    03-14-2005
    Posts
    21

    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

  2. #2
    Rowan
    Guest

    RE: Assign value to variable

    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
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1