I have a spreadsheet that in the last column there is a formula that calculates if there is any information in a previous column of the same row, to output √ and if not, output nothing. The √ is simply there as a marker and means nothing.
I now need a macro that can search up that last column (column EM) and find the first instance of the symbol and activate it in order to use this macro...
Any suggestions?Code:With Workbooks("November09_Webcon.xls").Worksheets("Baby") Range(ActiveCell, "BR2").Copy _ Destination:=.Cells(.Rows.Count, "A").End(xlUp)(2) End With End Sub
Last edited by amyxkatexx; 11-25-2009 at 01:39 PM.
Well, I have a formula that just says if there is anything in column BU or CB, then return √...that way I have a marker on the last column (column EM) on every row where this is information. If somehow a row is skipped though because the information sent to me accidentally skipped a line, there won't be a marker though, but that shouldn't matter if we are searching from the bottom up for the first instance of √. I just need a macro that can search in a single column (or if that's not possible, the whole spreadsheet) from the bottom of the column (or sheet) up and find the first instance of the √ (which is actually the last one if you are reading the sheet from top to bottom) and then make that cell active. My next macro is already built and working...it simply just starts with whatever cell is active and does it's thing...it's just getting the cell to be active is what I am needing.
If you need more info, here is a link to my original post and another I posted about this as well...here and here.
Also, I'm not sure if maybe you were just referring to how I made the symbol on the keyboard but after doing some research online, I've found that that symbol is not available on PC's, so for now we can just use § (opt+6 on Mac, alt+0167 on PC). That shouldn't matter really all that much though since the symbol in my code is interchangeable. Use any symbol you like and I'll change it for the purposes of testing.
Thanks!
I've done some more searching online and this is what I've come up with so far. Except now I am getting a compile error that says "Named argument not found."
The part in bold is what's new and all else is working just fine as two separate macros. I am just trying to simplify this process by combining them into one macro since the only step inbetween each macro is selecting the last cell of data.Code:Sub BabyTest() Selection.PasteSpecial Paste:=xlValues Cells.Select Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Sheets("Baby").Select Cells.Find(What:="√", After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _ MatchCase:=False, SearchFormat:=False).Activate With Workbooks("November09_Webcon.xls").Worksheets("Baby") Range(ActiveCell, "BR2").Copy _ Destination:=.Cells(.Rows.Count, "A").End(xlUp)(2) End With End Sub
What is wrong with what I added? I don't understand this stuff well enough to make my own changes, so I mostly just find stuff on other forums and hope that it works with what I'm doing. I am planning to learn how all this works, but for now I just need an answer.
Help!!
Ahh! Oh my goodness!
I figured it out all on my own!
Here is my finished code for anyone that is interested...
Code:Sub FTH() Selection.PasteSpecial Paste:=xlValues Cells.Select Selection.Copy Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Sheets("FTH").Select Range("A1").Select Cells.Find(What:="STOP", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious, _ MatchCase:=False).Activate With Workbooks("November09_Webcon.xls").Worksheets("FTH") Range(ActiveCell, "BR2").Copy _ Destination:=.Cells(.Rows.Count, "A").End(xlUp)(2) End With End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks