Results 1 to 9 of 9

Thread: Solved: IF...ELSE...THEN LOOP HELP Please Help!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    [vba]
    Sub INVOICEScheck()
    Dim wb As Workbook
    Dim ws As Worksheet
    Dim TheFile As String
    Dim MyPath As String
    Dim MySAVEAS As String
    Dim MyRange As Range

    MySAVEAS = "S:\Corp\NewFinance\National Accounts\6 SELF FUNDED BILLING\2 Non Imported"
    MyPath = "S:\Corp\NewFinance\National Accounts\6 SELF FUNDED BILLING\2 Weekly Invoices"
    Control = "S:\Corp\NewFinance\National Accounts\6 SELF FUNDED BILLING\1 CONTROL SHEET"
    Application.ScreenUpdating = False


    For Each cell In Range("MyRange")

    If cell.Value Then

    Workbooks.Open cell.Offset(0, 1).Value2 _
    , UpdateLinks:=3


    Run ActiveWorkbook.Name & "!Health"

    Exit For
    End If
    Next cell


    For Each ws In ActiveWorkbook.Worksheets
    Cells.Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues
    Range("A1").Select


    ActiveWorkbook.SaveAs Filename:=MySAVEAS & "\" & TheFile, _
    FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
    ReadOnlyRecommended:=False, CreateBackup:=False
    Next


    End Sub
    [/vba]
    Last edited by rbrizz11; 04-28-2011 at 11:49 AM.

Posting Permissions

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