Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

moving the stupid cursor one cell in xl 2003 vba?

I have a worksheet for my checking accounts and savings accounts in which i am using the savings portion for one of the accounts. I need a macro to find the current balance by starting at cell BD100 and going up 1 row at a time. Either I am stupid or XL can't do it or both...

I tried application.goto refererence:=("R&TEXT(currentrow,'0')&C56") and that does not work; it is complaining that the reference is not valid. I tried an indirect reference, Range(Range(xxxx).Select, a range function with Cells function in it. I also tried to record a macro and all stupid xl does is give you then ending cell to goto; it does not tell you how to move the cursor one cell in any direction....

I am using Win7-64, but that really should not make a diff. Howthehell do you get the stupid cursor to move using a range or "R1C1' variable reference to WORK??

Update:

ok, let me re-explain. i did a goto and put the cursor in the bottom row of the savings running balance column (BD100). My plan was that if I wanted to buy something that cost 100 bucks and I only had 95 bucks in the checking it would automatically:

1. start at bd100

2. go up column BD one row at a time until it finds the current (last) balance.

3. store that balance in another cell

4. do calcs to make sure that the money is there to be withdrawn (bank has minimum balance requirement).

5. IF there is enough money to transfer the necessary funds from savings to checking...(remember that we are in the row with the current balance) then,

6. move down 1 row to a blank transaction line.

7. transfer (copy/paste special) the amount to the new transaction line, along with the current date, transaction description, transaction code and..

8. let XL calc the new balance.

I changed variable names & tried what you wrote and it did not move the cursor from BD100, which is what I wanted.

1 Answer

Relevance
  • 1 decade ago
    Favorite Answer

    I am not exactly sure what you are trying to accomplish, but it would seem that you want to pull the current balance by finding the last entry in the 'balance' column.

    If so, and assuming the balance is contained in column D, then SavingsBal will always return the value of the last entry in that column:

    Dim SavingsBal

    SavingsBal = Range("D" & Rows.Count).End(xlUp).Value

Still have questions? Get your answers by asking now.