Results 1 to 3 of 3

VBA Loops

Threaded View

randomperson15 VBA Loops 12-05-2010, 09:42 PM
pike Re: Edited: VBA Loops 12-05-2010, 11:52 PM
randomperson15 Re: Edited: VBA Loops 12-06-2010, 12:40 AM
  1. #1
    Registered User
    Join Date
    12-05-2010
    Location
    la, ca
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA Loops

    Hi there

    I was wondering if anyone can help me with loops. I'm just learning this and am working on an exercise for class.

    Basically, the problem states that an aluminum structure is dipped in acid and loses 1% in weight each time it is dipped. The overall weight cannot be under 10 lbs so I would have to loop until the weight is about 10 lbs. Then find final weight depending on what the user has inputted prior to the structure being dipped (original weight).

    my code so far:
    
    Dim x As Long
    Dim y As Long
    Dim n As Long
    Dim j As Long
    
    
    
    
    If IsNumeric(TextBox1.Value) Then
        x = TextBox1.Text
            
        Do
        If j <= 10 Then Exit Do
        n = x * 0.01
        j = x - n
        Loop
        End If
    
    
    
    Label2.Caption = Format(j, "###0.00")
    I'm not really sure about what to do to make it work.
    Any help is greatly appreciated.
    Last edited by randomperson15; 12-05-2010 at 11:21 PM.

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