I really need help. I have a file that combines data (multiple rows and columns) for several regions. I need to be able to copy data for each region and copy it into the new sheet for that region.
Any help is greatly appreciated.
Thank you,
K
I really need help. I have a file that combines data (multiple rows and columns) for several regions. I need to be able to copy data for each region and copy it into the new sheet for that region.
Any help is greatly appreciated.
Thank you,
K
Something like this would work, im sure someone will be able to give you a better code but this would work.
![]()
Sub test() Dim DataLR As Long Dim Region As String Dim Counter As Long Dim RegionLR As Long With ActiveSheet DataLR = Range("A" & Rows.Count).End(xlUp).Row For Counter = DataLR To 2 Step -1 With Cells(Counter, "A") Region = Cells(Counter, "A").Value Range("A" & Counter & ":F" & Counter).Select Selection.Cut Sheets(Region).Select End With With ActiveSheet RegionLR = Range("A" & Rows.Count).End(xlUp).Row RegionLR = RegionLR + 1 ActiveSheet.Range("A" & RegionLR).Select ActiveSheet.Paste Selection.Copy Selection.PasteSpecial Paste:=xlPasteAll Application.CutCopyMode = False Sheets("Data").Select End With Next Counter End With End Sub
Thank you very much for the response. I tried to add the string into macro but it does not work. I am a total dummy then it comes to macros so I have no idea what is causing the problem. I attached file with the sample data. Individual tabs for the regions were created manually by copying and pasting the data into appropriate tabs. I have more than 50 regions with lots of rows and I waste so much time doing this manually
. Please HELP!
![]()
Last edited by ksenia81; 12-19-2012 at 05:47 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks