Results 1 to 5 of 5

connecting macros

Threaded View

ed ayers315 connecting macros 11-09-2009, 12:34 PM
JBeaucaire Re: connecting macros 11-09-2009, 01:08 PM
ed ayers315 Re: connecting macros 11-09-2009, 02:06 PM
JBeaucaire Re: connecting macros 11-09-2009, 02:16 PM
ed ayers315 Re: connecting macros 11-09-2009, 03:43 PM
  1. #1
    Registered User
    Join Date
    04-15-2009
    Location
    morristown, ny
    MS-Off Ver
    Excel 2007
    Posts
    39

    connecting macros

    JBeaucaire help me with the following code. It works great, I have 14 ranges like this on the same spreadsheet and would like to print all of them based on the result in the target cells for the range of each to print.

    I currently have a macro button to print each range as you can see. Is it possible to connect these? What I have tried is cutting the End Sub and then the Dim r As Long but get errors.


    
    Sub PrintVariedNumber_Products_1and2()
    Dim r As Long
    r = 43 + (Range("E7") * 44) - 44
    
        Range("A1:M" & r).PrintOut copies:=1
            
    
    End Sub
    Sub PrintVariedRange_Products_3and4()
    Dim r As Long
    r = 43 + (Range("S7") * 44) - 44
    
        Range("O1:AA" & r).PrintOut copies:=1
        
        
        
    End Sub
    
    Sub PrintVariedRange_Products_5and6()
    Dim r As Long
    r = 43 + (Range("AG7") * 44) - 44
    
        Range("AC1:AO" & r).PrintOut copies:=1
        
        
        
    End Sub
    Sub PrintVariedRange_Products_7and8()
    Dim r As Long
    r = 43 + (Range("AU7") * 44) - 44
    
        Range("AQ1:BC" & r).PrintOut copies:=1
        
        
        
    End Sub
    Sub PrintVariedRange_Products_9and10()
    Dim r As Long
    r = 43 + (Range("BI7") * 44) - 44
    
        Range("BE1:BQ" & r).PrintOut copies:=1
        
        
        
    End Sub
    Sub PrintVariedRange_Products_11and12()
    Dim r As Long
    r = 43 + (Range("BW7") * 44) - 44
    
        Range("BS1:CE" & r).PrintOut copies:=1
        
        
        
    End Sub
    Sub PrintVariedRange_Products_13and14()
    Dim r As Long
    r = 43 + (Range("CK7") * 44) - 44
    
        Range("CG1:CS" & r).PrintOut copies:=1
        
        
        
    End Sub
    Sub PrintVariedRange_Products_15and16()
    Dim r As Long
    r = 43 + (Range("CY7") * 44) - 44
    
        Range("CU1:DG" & r).PrintOut copies:=1
        
        
        
    End Sub
    Last edited by ed ayers315; 11-09-2009 at 03:47 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