View Full Version : [SOLVED:] insert name of tabs that had data copied in master tab
How insert name tab in cell?
Look code and file model
Hellow, somenone understand my question?
i can explain again...
p45cal
08-07-2014, 11:53 PM
impatient aren't we?
Don't know what you want so perhaps you'd better 'explain' since that was missing.
Just a guess:
Sub Copy_Sheets()
Dim ws As Worksheet
Dim lr As Integer
Application.ScreenUpdating = False
For Each ws In Sheets(Array("dante doc", "alan doc", "bruno doc", "aline doc"))
With ws
.Range("B8:D18").Copy
With Worksheets("summary doc").Range("B" & Cells(Rows.Count, 2).End(xlUp).Row + 1)
.PasteSpecial (xlPasteValues)
.Offset(, -1).Value = ws.Name
End With
End With
Next ws
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Hi, thnaks for rep
you cide make it
Nome
relatorio
Numero
Local
dante doc
Campo
1
Rua da Alegria
Tecnico
13
Porão
alan doc
151515
4234zfdsf1323
Rua Vladimir Sinkus
151516
4234zfdsf1324
Rua Bottivinl
bruno doc
10101010101
252525252
Rua da Gambiarra
aline doc
22222222
99999999999
Rua de Medicina
22222223
99999999910
Rua Bazlio
22222224
99999999911
Rua de Carlito
I need this way
Nome
relatorio
Numero
Local
dante doc
Campo
1
Rua da Alegria
dante doc
Tecnico
13
Porão
alan doc
151515
4234zfdsf1323
Rua Vladimir Sinkus
alan doc
151516
4234zfdsf1324
Rua Bottivinl
bruno doc
10101010101
252525252
Rua da Gambiarra
aline doc
22222222
99999999999
Rua de Medicina
aline doc
22222223
99999999910
Rua Bazlio
aline doc
22222224
99999999911
Rua de Carlito
thank you!!
p45cal
08-08-2014, 08:19 AM
try:
Sub Copy_Sheets()
Dim ws As Worksheet
Dim lr As Integer
Application.ScreenUpdating = False
For Each ws In Sheets(Array("dante doc", "alan doc", "bruno doc", "aline doc"))
With ws
Set SourceRng = .Range("B8").CurrentRegion
Set SourceRng = SourceRng.Offset(1).Resize(SourceRng.Rows.Count - 1)
SourceRng.Copy
With Worksheets("summary doc").Range("B" & Cells(Rows.Count, 2).End(xlUp).Row + 1)
.PasteSpecial (xlPasteValues)
.Offset(, -1).Resize(SourceRng.Rows.Count).Value = ws.Name
End With
End With
Next ws
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.