I have a workbook created to keep track of financial information sorted monthly on separate sheets with a totals page. All the pages are set up the same as far as cell locations, on my totals page they are broke into the different categories and I am pulling info for each month to my totals page. I have set up the first month and wanted to know if there was a way to set up the others without typing each cell individually? I have attached the file to show what I am doing. Thanks in advance for any help
Last edited by metalman32060; 03-02-2011 at 06:15 PM. Reason: title change
This VBA should do it
Sub Copy_right() Dim R_text As String Dim W_text As String For i = 1 To 11 Range("A3").Select Do While ActiveCell.Offset(0, 1).Value <> "" ActiveCell.Offset(0, 1).Activate Loop Range(ActiveCell, ActiveCell.Offset(22, 0)).Select If i = 1 Then R_text = ActiveCell.Offset(-1, 0).Value & "!$" W_text = ActiveCell.Offset(-1, 0).Value & "!" Selection.Replace What:=W_text, Replacement:=R_text, LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End If Selection.Copy ActiveCell.Offset(0, 1).Activate ActiveSheet.Paste Application.CutCopyMode = False R_text = ActiveCell.Offset(-1, 0).Value W_text = ActiveCell.Offset(-1, -1).Value Selection.Replace What:=W_text, Replacement:=R_text, LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False Next i Range("A1").Select End Sub
Wow,
Thanks you so much, had to google how to use a macro properly =) but worked perfectly
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks