Hi.
how to find small tables and copy each for a guide?
I created the tabs manually, the code has to pick up the tab master data, and create tebela 1 for the first intervalor with data, and so
Hi.
how to find small tables and copy each for a guide?
I created the tabs manually, the code has to pick up the tab master data, and create tebela 1 for the first intervalor with data, and so
hi marreco.
try this.
it assumes tables are seperated with at least 1 blank row.
[VBA]
Sub FindMultipleInstancesAddWsCopyFoundCellCurrentRegion()
'adopted from: http://www.cpearson.com/excel/FindAll.aspx
Dim LookUpRng As Range, LastCell As Range, FoundCell As Range
Dim FirstAddress As String, SearchStr As String, TabName As String
SearchStr = "TABELA"
Set LookUpRng = Worksheets("Master").UsedRange
With LookUpRng
Set LastCell = .Cells(.Cells.Count)
Set FoundCell = .Find(What:=SearchStr, _
after:=LastCell, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)
End With
If Not FoundCell Is Nothing Then
FirstAddress = FoundCell.Address
Do
TabName = Mid(FoundCell, InStr(1, FoundCell, SearchStr))
Worksheets.Add(after:=Worksheets(Worksheets.Count)).Name = TabName
FoundCell.CurrentRegion.Copy ActiveSheet.Cells(1, 1)
Set FoundCell = LookUpRng.FindNext(FoundCell)
Loop Until FoundCell.Address = FirstAddress
End If
End Sub
[/VBA]
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
Hi.
I'm very glad you help me!
very perfect!!
thank you very much!!
you are welcome.
and thanks for marking the thread as "solved".
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)