Hello all,
I'm using Excel 2013. Talk about WOW!!! Two weeks ago I didn't even know what VBA was. It all started with a google search on how to update tab colors automatically. ExcelVBAIsFun, Excel Forum, and Ctrl+G ever since! however, my current ambitions significantly out weigh my shred of knowledge. I am hoping to acquire a little from the seasoned VBA guys and gals today. I am attempting to cut and paste a row (cut and paste occurs on the same sheet {pic}) if a cell value within that row is ">=" a cell value on a different sheet.
Screenshot (2).jpg
I'm working on a monthly template for sales data that dictates the commission rate and tracks consistency. There is a performance summary on sheets(1) and data consolidation on sheets(2). The next 31 sheets are daily reports, 1 for every day of the month and the tab names have a macro to update to the correct day depending on the month. Right now I am using the code below to copy/paste daily sales reports from their respective sheet to the consolidation sheet. If a sales contract doesn't close within the current month then I need to remove the row from the left and place it on the right. the current month contracts go in columns A-H, and all other contracts are M-T. The headers are identical in order from left to right(SDate, #, #, $, $, $, #, EDate). Some of the rows that will need to be moved have blanks. I attempted to create a table for this thread but it gave me a vertical line of text in my comment box. Monkey and a football. I had no idea what to do with it.
Is it possible to add the CUT/PASE to the end of this, or is it best to use a different macro. If a separate macro is needed, would it be possible to activate that macro every time one of the daily reports is copied? I am extremely proud of that code above haha, but im sure it looks like a steam engine sitting next to the Atlantis. Also, the macro above is 1 of 31. Each daily report has its own macro with this code tweaked for sheets(X), and all of those macros are in the same module. I have scoured the forums trying to fit blocks of code into my scenario stated above with no luck. I get to the point where I am no longer learning, just confusing myself even more.
If anyone has the patients to explain how a solution to my issue works I would really appreciate the "fishing pole" as apposed to the "fish"
Many thanks for any input anyone provides!!!
I'm using Excel 2013. Talk about WOW!!! Two weeks ago I didn't even know what VBA was. It all started with a google search on how to update tab colors automatically. ExcelVBAIsFun, Excel Forum, and Ctrl+G ever since! however, my current ambitions significantly out weigh my shred of knowledge. I am hoping to acquire a little from the seasoned VBA guys and gals today. I am attempting to cut and paste a row (cut and paste occurs on the same sheet {pic}) if a cell value within that row is ">=" a cell value on a different sheet.
Screenshot (2).jpg
I'm working on a monthly template for sales data that dictates the commission rate and tracks consistency. There is a performance summary on sheets(1) and data consolidation on sheets(2). The next 31 sheets are daily reports, 1 for every day of the month and the tab names have a macro to update to the correct day depending on the month. Right now I am using the code below to copy/paste daily sales reports from their respective sheet to the consolidation sheet. If a sales contract doesn't close within the current month then I need to remove the row from the left and place it on the right. the current month contracts go in columns A-H, and all other contracts are M-T. The headers are identical in order from left to right(SDate, #, #, $, $, $, #, EDate). Some of the rows that will need to be moved have blanks. I attempted to create a table for this thread but it gave me a vertical line of text in my comment box. Monkey and a football. I had no idea what to do with it.
Code:
Sub Copy_Paste_to_CLOSING_RPD_Sheet3()
Dim Response As Integer
NofC = ThisWorkbook.Sheets(3).Cells(Rows.Count, 2).End(xlUp).Row - 1
openedON = Format(ThisWorkbook.Sheets(3).Range("A2"), "dddd, d")
CuMo = Format(ThisWorkbook.Sheets(3).Range("A2"), "MMMM")
Response = MsgBox(prompt:="You are about to copy this worksheet to the CLOSING RPD tab. " & _
"Click 'Yes' to continue, or 'No' to cancel the operation.", Buttons:=vbYesNo, Title:="ARE YOU SURE?")
If Response = vbYes Then
Range("B2").Select
Selection.End(xlDown).Offset(1, -1).Select
Range(ActiveCell, Cells(ActiveCell.End(xlDown).Row, 8)).Select
Selection.Delete Shift:=xlUp
Range("A2").Select
Application.CutCopyMode = False
Range("A2:H" & Range("A1000").End(xlUp).Row).Copy
Worksheets("CLOSING RPD").Activate
Range("A" & Range("A65500").End(xlUp).Row + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A2").Select
MsgBox NofC & " contracts opened on '" & openedON & "' have been added to the CLOSING RPD tab for " & _
CuMo, vbOKOnly, "CONTRACTS ADDED"
Else
MsgBox "No data has been copied.", vbOKOnly, "CANCELLED"
End If
End Sub
If anyone has the patients to explain how a solution to my issue works I would really appreciate the "fishing pole" as apposed to the "fish"
Many thanks for any input anyone provides!!!