How to Copy data from one sheet to another.

Good afternoon,

I am rather new to using excel so please forgive me if I sound like an idiot....

I am working on a spread that performs a query to an Oracle database so that I can have real time data to work with for some dashbaords that we have displayed in out lobby. One of the issues I am having is seperating out some of my data. Now I will appolgize in advance for not being able to post a sample of my data, but all of my data is propritary information.

In Sheet 2, Column B there is a list of names. Those names will not change. Each name in Column B has a corespnding sheet in the workbook. I want to copy all of the data for each name to the matching sheet.

Vikas Verma's picture

Try this

Hi Dear,

Hope this will help you..

Sub testing()

Dim shcount As Long
Dim sh As Worksheet
Dim Rcount As Long

shcount = ThisWorkbook.Sheets.Count
Set sh = ThisWorkbook.Sheets("Sheet1")

For i = 2 To shcount
sh.Range("A1").AutoFilter field:=1, Criteria1:=Sheets(i).Name
Rcount = Sheets(i).Cells(Rows.Count, 1).End(xlUp).Row + 1
sh.Range(Range("A1").Offset(1), Range("A1").CurrentRegion.SpecialCells(xlCellTypeVisible).SpecialCells(xlCellTypeLastCell)). _
Copy Destination:=Sheets(i).Range("A" & Rcount)
Next i
sh.AutoFilterMode = False
End Sub