+ Reply to Thread
Results 1 to 1 of 1

VBA looping with matrix of data over multiple sheets

Hybrid View

  1. #1
    Registered User
    Join Date
    10-12-2011
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    1

    Question VBA looping with matrix of data over multiple sheets

    I am fairly new to the VB programming of Excel and have to perform a specific process repeatedly; and I can't develop a simple solution.

    Right now I have a workbook with 41 sheets; One of them is a summary that totals all the requests from the other pages. I currently have code that checks the Total requests of a particular variant / market field and then numbers the rows of Column A sequentially from 1 until it equals the Total requests. Along with this I would also like to query every sheet and if the value in a specific cell is > 0 then return the requestors name equal the the number of units requested in column "E". Below is an example of the code that I have that works but is extremely tedious as well:

    Place = RowCount - NumRet
                    
                    If MasterRowCount = 1 Then
                        val = ActiveWorkbook.Worksheets("Xyz").Cells(9, 3).Value
                        If val > 0 Then
                            Do
                                DeptCounter = DeptCounter + 1
                                Cells((Place), "E") = "Xyz"
                                Place = Place + 1
                            Loop Until DeptCounter = val
                        End If
                        DeptCounter = 0
                        val = ActiveWorkbook.Worksheets("xYZ").Cells(9, 3).Value
                        If val > 0 Then
                            Do
                                DeptCounter = DeptCounter + 1
                                Cells((Place), "E") = "xYZ"
                                Place = Place + 1
                            Loop Until DeptCounter = val
                        End If
                    End If
    Any help will be greatly appreciated.
    Last edited by zzschmidt; 10-12-2011 at 03:31 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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