Results 1 to 20 of 23

Thread: Helping a student automate a couple of sheets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    VBAX Regular
    Joined
    Sep 2016
    Posts
    44
    Location
    When I do as suggested or at least i hope I did, i get an error

    debug.jpg

    Please correct this if it is wrong....

    Option Explicit 
     
    Sub NumbersGrabber() 
        Dim InputSht As Worksheet 
        Dim DrnNumSht As Worksheet 
         
        Static NextRowToUse As Long 'maintains State between calls as long as Workbook is open. With caveats.
         
        Set InputSht = Sheets("Input") 
        Set DrnNumSht = Sheets("Drawn Numbers") 
         
        If NextRowToUse = 0 Then NextRowToUse = 2500 
        If NextRowToUse = 1 Then Exit Sub 
         
        DrnNumSht.Cells(NextRowToUse, "I").Resize(, 7).Copy 'Resize(0 Rows, 7 Columns)
        InputSht.Range("I49").Resize(, 7).Insert shift:=xlShiftDown 
        NextRowToUse = NextRowToUse - 1 
         
        ertert 'Run the etert Procedure
        NumbersGrabber 'get more numbers
    
    End Sub
    thanks SamT
    Last edited by MrSams; 09-27-2016 at 08:48 PM. Reason: spelling

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •