excel function to change specific cell value

K

kidbethesda

Version: 2004
Operating System: Mac OS X 10.4 (Tiger)
Processor: Intel

Im doing volunteer work at the Smithsonian institution and have gotten over my head in excel. did some basic, pascal, and c++. however this spreadsheet stuff is still not too real to me.
Normal procedure to put a value into a cell from another cell is to manually copy or cut then move cursor to highlight destination cell and paste. this is done from either the keyboard or the command bar.

However how can it be done as part of a logic statement. say a string of if statements.

as part of that, I want to put several if statements together. how is that done.

In basic on excel line numbers there are no line numbers displayed in the body of the program. my attempt to do a goto by counting the lines and writing goto 6 or whatever...causes an error message.... what did I do wrong?

thanks for thinking about this.. my email is (e-mail address removed)
 
J

JE McGimpsey

Version: 2004
Operating System: Mac OS X 10.4 (Tiger)
Processor: Intel

Im doing volunteer work at the Smithsonian institution and have gotten over
my head in excel. did some basic, pascal, and c++. however this spreadsheet
stuff is still not too real to me.
Normal procedure to put a value into a cell from another cell is to manually
copy or cut then move cursor to highlight destination cell and paste. this is
done from either the keyboard or the command bar.

However how can it be done as part of a logic statement. say a string of if
statements.

as part of that, I want to put several if statements together. how is that
done.

In basic on excel line numbers there are no line numbers displayed in the
body of the program. my attempt to do a goto by counting the lines and
writing goto 6 or whatever...causes an error message.... what did I do wrong?

So you're trying to do this via VBA?

Not sure what "if statements" have to do with copying and pasting.

If statements are of the form:

If <condition> Then <statement>

If <condition> Then
Statement 1
Statement 2
End If

If <condition 1> Then
Statement 1
ElseIf <condition 2>
Statement 2
Else
Statement 3
End If

Copy/Paste statements generally take the form

Range("A1").Copy Destination:=Range("J1")

or if you just want the value transferred:

Range("J1").Value = Range("A1").Value


Modern programming techniques almost always *avoids* "GoTo" statements -
they're hard to follow compared to structured If..Then..Else or
Do...Loop statements, but you CAN still use them:

Statement 1
If <condition> Then GoTo FurtherOn
Statement 2
Statement 3
FurtherOn:
Statement 4

But that's equivalent to the preferred method:

Statement 1
If Not <condition 1> Then
Statement 2
Statement 3
End If
Statement 4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top