MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Get and set a value?

  Asked By: Hayed    Date: Sep 19    Category: MS Office    Views: 1159

I'm trying to do the following...

1) Set a var equal to a cell value
2) I will then use a Select Case statement to decipher the value
3) Once I get the value, I'll set another value
4) I then need to put that resulting value in another cell location

The problem is I don't know how to get and set a value into cells in Excel.
If it were, say a Word form, I'd do something like...

Get a value from a form field in Word...

myVar = ActiveDocument.FormFields("myFirstMarker").Range.Text

Set a value in a form field in Word...

ActiveDocument.FormFields("myBookmark").Result = myVar

But I don't know how to start calling the sheet and how the syntax works for
locating a cell range??? I'd appreciate it if someone could tell me how to
do this in Excel...getting a value from one cell...and then putting a var
value into a cell.



4 Answers Found

Answer #1    Answered By: Utsav Shah     Answered On: Sep 19


Answer #2    Answered By: Ziza Mizrachi     Answered On: Sep 19

Just getting back to this and forgot that I'd asked for help...so I went
looking to see if there was an answer. Appreciate the help. Now I can code
up my grade spreadsheet as it SHOULD be with proper automation.

Answer #3    Answered By: Fairuzah Alam     Answered On: Sep 19

shorter than Word! Which is why I am lousy with the Word
object model. I normally get someone else to do Word stuff for me.

Answer #4    Answered By: Gerardo Morgan     Answered On: Sep 19

yeah and why I get someone else to do my Excel automation. Maybe we
should work out a deal!<g>

Didn't find what you were looking for? Find more on Get and set a value? Or get search suggestion and latest updates.