Results 1 to 5 of 5

Loop through Worksheets find Value & Paste in another Worksheet, SUM values from Column

Threaded View

  1. #1
    Registered User
    Join Date
    09-14-2013
    Location
    Somewhere,there
    MS-Off Ver
    Excel 2003
    Posts
    2

    Loop through Worksheets find Value & Paste in another Worksheet, SUM values from Column

    PROBLEM SOLVE LOOK LAST POST

    Hi I have 12 Workboots (each for every month) name Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec
    These workbookts contains something like the following


    Name Days of Vacation Something Else#1 Something Else#2
    Mary 5 etc etc
    George 3
    John 12 etc etc
    Gary 13 etc etc

    I want something to loop through the months and copy all rows for mary in a summary sheet and sum the Days of Vacation from Column B in the lastrow+1

    Of course I dind't come here empty handed, but I can't advance any further.
    Could you help me?

    Please Note that The first Workbook has some data, the 2nd Workbook is the Jan and the 13 Workbook is the Dec, the 14t is the Summary Workbook

    Sub SearchForString()
    Application.Calculation = xlCalculationManual
    Dim LSearchRow As Integer
    Dim LCopyToRow As Integer
    LCopyToRow = 2
    LSearchRow = 2
     fname = InputBox("Input Name", "Input Name")
          If fname = "" Then
       While fname = ""
       MsgBox ("Fatal Error")
       fname = InputBox("Input Name", "Input Name")
      Wend
      End If
    For i = 2 To 13 
    On Error GoTo Err_Execute
    MsgBox Sheets(i).Cells(LSearchRow, 1).Value
            Do While Len(Sheets(i).Cells(LSearchRow, 1).Value) > 0
            If Sheets(i).Cells(LSearchRow, 2).Value = fname Then
                Sheets("Summary").Range(Sheets("Summary").Cells(LCopyToRow, 1), _
                        Sheets("Summary").Cells(LCopyToRow, 37)) = _
                               Range(Sheets(i).Cells(LSearchRow, 1), _
                                           Sheets(i).Cells(LSearchRow, 37)).Value
                LCopyToRow = LCopyToRow + 1
                LSearchRow = LSearchRow + 1
                If i = 3 Then
                MsgBox (i = 3)
                End If
            End If
    
    
           
            
        Loop
    Next i
    MsgBox ("The value of the counter in the last loop was " & i)
    End Sub
    Last edited by Myth0S; 09-15-2013 at 05:15 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. loop worksheets find date in cell activate worksheet
    By cdy3900 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-11-2013, 02:39 PM
  2. [SOLVED] Loop to Paste Values in a Different Column
    By nevi in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 01-01-2013, 05:52 PM
  3. Vba - find next empty column, insert column, copy paste values & copy paste formulas
    By DoodlesMama in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 12:43 PM
  4. [SOLVED] Loop, Find, Copy, and Paste between multiple worksheets
    By bg_enigma1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-07-2012, 06:40 PM
  5. Loop to find cell, paste to new column. Turn 1 column into many.
    By d0tc0m in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2011, 09:51 AM

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