Hi I have a code which is given and working fine. Using that code I am getting only 50% information which is required. Please help me editing that script in a way which will give me the output the way I want.
In page 1 the data is in different rows and columns and I have 20 pages like that. I have the data in different rows and columns from page2 to page20. (All the data will be in same rows and columns for all these sheets except page 1). One more thing the below code is only gathering the data for only the below queue name and if there exists another queue name it is not giving the output for the second queue name. So I need is For a name specified if there are 2 queues also i need that information also to be in my output. The same way I need the output from the remaining pages (2,3,4....) to be in the same page. I mean I need finally all the data to be in a single sheet.
The data for a name in page 1 some times will be in page 2 or the same way in the next page also.
I may not be clear to you. So, please have a look at the pages first and also run the macro which is given below to understand first what I am trying to say and help me. I need the output in the same format the one which you will get after running the macro given below. Please some one save me...
Sub Gather_Data() Dim vD As Variant Dim x As Long Dim y As Long Dim z As Long 'COLLECT DATA With Worksheets("Sheet1") vD = Intersect(.Columns("F:F"), .UsedRange) ReDim Preserve vD(1 To UBound(vD), 1 To 4) For x = 1 To UBound(vD) If Not IsEmpty(vD(x, 1)) Then vD(x, 2) = .Cells(x + 1, 3) If .Cells(x + 3, 3) = "Total" Then vD(x, 3) = .Cells(x + 3, 11) vD(x, 4) = .Cells(x + 3, 45) Else vD(x, 3) = .Cells(x + 1, 10) vD(x, 4) = .Cells(x + 1, 45) End If End If Next x End With 'POST DATA With Worksheets("Sheet2") z = .Cells(.Cells.Rows.Count, 1).End(xlUp).Row + 1 For x = 1 To UBound(vD) If Not IsEmpty(vD(x, 1)) Then For y = 1 To 4 .Cells(z, y) = vD(x, y) Next y z = z + 1 End If Next x End With End Sub
It will be good if you attach a sample of the macro output so we can see and understand what your requirement is.
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
I have given the macro above. That is the macro which i am using now.
No no, attach the output obtained from the macro.
Cheers,
Arlette
If I helped, Don't forget to add to my reputation (click on the star below the post)
Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
Use code tags when posting your VBA code: [code] Your code here [/code]
Hi kishoremcp,
It seems you need to cycle through all your worksheets and add the data to the Data sheet. I think you need to use the Worksheet Index notation to do this is VBA. Worksheets.Count will be the number of worksheets and Worksheets(Index) will go from left to right across them.
Something like this code below
Dim ShtCtr as double For ShtCtr = 2 to Worksheets.Count With Worksheets(ShtCtr) 'do some code in here to gather your sheet data End With Next ShtCtr
One test is worth a thousand opinions.
Click the * below to say thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks