×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Excel VBA: Difference between revisions

    imported>DrOwl
    m (Reverted edits by WilberrX09H (talk) to last revision by DrOwl)
    imported>DrOwl
    m (Changed protection level for "Excel VBA" ([edit=sysop] (expires 21:00, 18 December 2011 (UTC)) [move=sysop] (expires 21:00, 18 December 2011 (UTC))))
     
    (3 intermediate revisions by 2 users not shown)
    (No difference)

    Latest revision as of 01:37, 19 November 2011

    Some usefull snips of Excel VBA that i use.


    work with multiple Worksheets[edit]

    this macro will Loop through all work sheets doing X... i found this on utteraccess this thread

    Public Sub UpdatetoNextWeek()
    
    
    Dim w As Excel.Worksheet
    
    
    If MsgBox("Update the week and period details?", vbYesNo + vbQuestion, "Confirm update") = vbYes Then
    
    For Each w In ActiveWorkbook.Worksheets
    
    w.Range("H9") = w.Range("H9") + 1
    w.Range("F9") = w.Range("F9") + 7
    Next w
    MsgBox "Done", vbOKOnly
    
    End If
    
    End Sub
    
    
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.