efficient code to move group of cells from one tab to another

TravelingMan

New Member
Joined
Jun 8, 2015
Messages
8
hey guys,

I have a tab that has main info. The tab has the code below to filter out and create new sheets based on a word.

I am trying to get certain cells from the output to be placed in corresponding cells within other tabs instead of random sheets. how can I have the data go from the main tab and move to other tabs (tabs available are 201, 101, 301, 401) cells to be placed in B22, C22, E22 OF Each corresponding tab

Sub test()
Dim myAreas As Areas, myArea As Range, n As Long
Const wsName As String = "Result"
CheckWS wsName
Sheets(wsName).Cells.Clear
With Sheets("Aged DQ").Cells(1).CurrentRegion
.Rows(1).Copy Sheets(wsName).[b1]: n = 2
On Error Resume Next
Set myAreas = .Columns(1).SpecialCells(2, 1).Areas
On Error GoTo 0
If Not myAreas Is Nothing Then
For Each myArea In myAreas
myArea(0).Copy Sheets(wsName).Cells(n, 1).Resize(myArea.Count)
myArea.Resize(, .Columns.Count).Copy Sheets(wsName).Cells(n, 2)
n = n + myArea.Count
Next
Else
MsgBox "No dates"
End If
End With
End Sub

Is there a better way? I am not good at VBA but trying to learn. also,

see the sheet attached.

As you can see there are numbers and dates in the same column (these need to be separated)

Every number would have a created worksheet.. (which will already be generated) Information in the Date column (not whole numbers would need to be dates starting in Cell b22 and going down.. category column would start at c22 in each sheet and go down and the amount column would start at E22 and go down.

any help would be appreciated.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,214,788
Messages
6,121,603
Members
449,038
Latest member
Arbind kumar

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