+ Reply to Thread
Results 1 to 10 of 10

Help With Looping Macro

Hybrid View

  1. #1
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,779

    Re: Help With Looping Macro

    Add lines in red:

    Dim rCell As Range
    Set rCell = Range("B7")
    Dim sDesc As Range
    Set sDesc = Range("C7:O7")
    Dim sDiv As Range
    Set sDiv = Range("P7:X7")
    Dim dEnd As Range
    Set dEnd = Range("Y7:AA7")
    
    
    
       If Not IsEmpty(rCell) Then
            For Each rCell In sDesc
                If IsEmpty(rCell) Then
                    Msg = MsgBox("Please Fill In Blank Cell " & rCell.Address & " Before Saving")
                    Cancel = True
                    Exit For
                End If
            Next
            If WorksheetFunction.CountA(sDiv) = 0 Then
                Msg = MsgBox("Please Fill In a Division For Cells Between sDiv")
                Cancel = True
            End If
            For Each rCell In dEnd
                If IsEmpty(rCell) Then
                    Msg = MsgBox("Please Fill In Blank Cell " & rCell.Address & " Before Saving")
                    Cancel = True
                    Exit For
                End If
            Next
          End If
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  2. #2
    Registered User
    Join Date
    05-16-2017
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    51

    Exclamation Re: Help With Looping Macro

    Sorry 6StringJazzer for the mistake above will read the rules today.

    Sorry my post wasn't more detailed. The VBA above i originally wrote works perfect but only works for row 7. I need the above VBA to do the same for row 8 if there's something written on cell "B8" and the same on "B9" ect. I've attached the forum which the code is running on. So you may get a better understanding.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Macro to create a looping macro to populate another worksheet.
    By sungen99 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 06-22-2016, 10:53 AM
  2. Help with looping my macro
    By dry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2015, 11:19 AM
  3. Looping Macro
    By ashar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2013, 07:50 PM
  4. [SOLVED] Help with looping a macro
    By jumpingoff in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2012, 04:15 PM
  5. Looping Macro
    By ExcelGuy160 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2010, 06:37 PM
  6. Looping macro
    By mbenazeraf in forum Excel General
    Replies: 13
    Last Post: 01-18-2010, 02:20 PM
  7. Looping a macro
    By Toadums in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-31-2008, 01:07 PM

Tags for this Thread

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