First off, new to macros but have had success with recording a few and using a few from this forum. Now for what I am trying to accomplish and hope somebody can help. I have a sheet titled "Floor Plan". Within "Floor Plan", Column "K" will contain currency formatting until the date it is paid at which time an input person will change the cell to "Paid xx/xx/xx". I would like to create a macro that we could choose when to initiate it, beginning on row 9, searching for any cell in column "K" that contains the word "Paid" or "PAID" and cut the entire row, paste it to the next available row in a sheet named "Paid TRs". I would then like the blank rows on "Floor Plan" to be deleted and (xlUP[?]). A button to run this would be nice but a keyboard shortcut will also work.
This is my first time posting so please forgive me if my jargon is insufficient!![]()
Last edited by ruthieag; 08-26-2011 at 04:06 PM.
I would use Excel's AutoFilter for this. This is easy to construct when looking at your real layout with a reasonable amount of sample data in it.
Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Thank you for your willingness to help. The attached is my work in progress. It has a current macro in it that will add a row to the end of my Floor Plan sheet with formulas needed. I have estimated the most number of rows needed for data with our size of institution would be 100. There will be a few users of this workbook with different needs so I want to keep the Floor Plan sheet looking clean.
I attached my workbook previously, however, unsure if I used the correct method so you would be notified of such.
This should do it:
Option Explicit Sub TransferPAID() 'Jerry Beaucaire 8/17/2011 Dim LR As Long With Sheets("Floor Plan") .AutoFilterMode = False .Rows("8:8").AutoFilter .Rows("8:8").AutoFilter Field:=11, Criteria1:="=Paid*" LR = .Range("A" & .Rows.Count).End(xlUp).Row If LR > 8 Then .Range("A9:A" & LR).EntireRow.Copy Sheets("Paid TRs").Range("A" & Rows.Count).End(xlUp).Offset(1) .Range("A9:A" & LR).SpecialCells(xlVisible).EntireRow.Delete xlShiftUp End If .AutoFilterMode = False End With End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
Works great! Thank you for your time and effort. It's great that you share your knowledge with those of us that only think it can happen.
I was ready to roll out my project and performed a final test. When I placed "Paid" in cell K:9, the auto filter does not work correctly with The Option Explicit - Sub TransferPaid macro. It seems to work well in all other cells in column K. The other issue I have, which is not as important, is that after I have "transferred paid" rows and then try to "insert rows w/formulas", there are empty rows between my last row with data and my inserted row with formulas. I have attached the latest version of my workbook. The Macro Sheet will be hidden to other users in final version.
Try changing this one line:
.Range("A9:A" & LR).EntireRow.Delete xlShiftUp
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
For your insert row, this should do it:
Sub InsertRow() ' ' InsertRow Macro ' Keyboard Shortcut: Ctrl+Shift+I ' Sheets("Macro Sheet").Range("A18:U18").Copy _ Sheets("Floor Plan").Range("F" & Rows.Count).End(xlUp).Offset(1, -5) End Sub
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks