Can this be done

harshab6

Active Member
Joined
Oct 1, 2008
Messages
254
I have got 78 worsheet in a single workbook out of that 39 sheets are named as june 11, june 11(1),june 11(2)…….june11(39) and other 39 is named as cash for june11, cash for june 11(2),…….Cash for june11(39). All the data from June11 to june(39) should be consolidated in single sheet(excluding blanks) and data from cash for june 11 to cash for june(39) in other sheet(excluding blanks) .I know the macro for consolidating all the sheets in single sheet .But I am unable to figure out how to write coding in this Criteria I am trying it from 2 days but didn,t get any result can anyone help me with this.
:banghead:
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
This is an example to adapt at your requirements:
Code:
Sub mm()
For i = 1 To Sheets.Count
If Mid(Sheets(i).Name, 1, 6) = "June11" Then
r = 1
While Sheets("Total").Cells(r, 1) <> 0
r = r + 1
Wend
Sheets("Total").Cells(r, 1) = Sheets(i).Cells(1, 1)
End If
Next
End Sub
Something like this?
 
Upvote 0
Hi Machopicho,

thanks for the reply but this doesnot fullfill my creteria.I have written certain code but its shows the error message cannot figure were I went wrong can you put some light on it.

Sub mergesheets()

Dim ws As Worksheet, wsOut As Worksheet, sName As String
sName = "june'11"
Set wsOut = Worksheets.Add(after:=Sheets(Sheets.Count))
For Each ws In Worksheets
If UCase(ws.Name) Like UCase(sName) & "*" Then
ws.UsedRange.Offset(3).Copy
With Range("A65536").End(xlUp).Offset(1, 0)
PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
.PasteSpecial Paste:=xlFormats, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

End Sub
thanks for help
Harsha
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top