LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default if then and do - DA

OK, folks. I've been away from macros for too long and can't get it
right for something this simple! I think i keep reverting to Fortran
days! Kindly help.

Here is my sorry-assed attempt at a macro that is supposed to copy
from one cell and paste its value to another, until some third cell is
close to zero. The purpose of this is to avoid having to use
iterative mode, which I don't like becasue it masks other programming
errors.

Though I know there are always more creative ways to do these things,
it might be best if you just correct what i've done in the most simple
way, so that i can re-learn the basics. of ifs, thens, and loops.

Thanks much
Dean

Option Explicit
Sub fortyeightMIRBal()

Dim j As Integer
Dim myvalue As Variant
For j = 1 To 1000
myvalue = Range("EndingIRBalance48").Value
If Abs(myvalue) 0.001 Then
Range("TotalInterest48").Select
Selection.Copy
Range("IntReserveBalance48").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Else: GoTo 100
End If
Next j
100
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"