Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through rows evaluating 2 cells
I am building a utility that will allow the user to iterate down a undermined amount of rows. The script needs to evaluate the followin on the active row: If the active cell in column a < "" and the activ cell in column k = "" then the active cell in column k = k4.value. Thanks in advance for your assistance! :rolleyes -- mthoma ----------------------------------------------------------------------- mthomas's Profile: http://www.excelforum.com/member.php...fo&userid=2564 View this thread: http://www.excelforum.com/showthread.php?threadid=39058 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through rows evaluating 2 cells
Sub ABCD()
Dim i as Long, lastrow as Long lastrow = cells(rows.count,1).End(xlup).row for i = 5 to Lastrow if cells(i,1).Value < "" and cells(i,"K").Value = "" then cells(i,"K").value = cells(4,"K").value end if Next i End sub -- Regards, Tom Ogilvy "mthomas" wrote in message ... I am building a utility that will allow the user to iterate down an undermined amount of rows. The script needs to evaluate the following on the active row: If the active cell in column a < "" and the active cell in column k = "" then the active cell in column k = k4.value. Thanks in advance for your assistance! -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=390580 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through rows evaluating 2 cells
Tom, Thanks for the reply and it works! But could you please explain wha this line is doing.... lastrow = cells(rows.count,1).End(xlup).row Thanks again for you help on this and have a great day -- mthoma ----------------------------------------------------------------------- mthomas's Profile: http://www.excelforum.com/member.php...fo&userid=2564 View this thread: http://www.excelforum.com/showthread.php?threadid=39058 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
loop through rows evaluating 2 cells
If you went to the bottom of the worksheet (or any cell past you data ) and
selected a cell, then hit the END key , then the Up Arrow, the selection would move to the last cell in that column containing data or a formula. That is what the code does - finds the last cell in the column containing data or a formula and returning the row number of that cell. -- Regards, Tom Ogilvy "mthomas" wrote in message ... Tom, Thanks for the reply and it works! But could you please explain what this line is doing.... lastrow = cells(rows.count,1).End(xlup).row Thanks again for you help on this and have a great day! -- mthomas ------------------------------------------------------------------------ mthomas's Profile: http://www.excelforum.com/member.php...o&userid=25649 View this thread: http://www.excelforum.com/showthread...hreadid=390580 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Evaluating a group of cells | Excel Discussion (Misc queries) | |||
evaluating text of cells | Excel Discussion (Misc queries) | |||
Evaluating Empty Cells | Excel Programming | |||
Evaluating Empty Cells | Excel Programming | |||
Loop cells - get all rows with matching data - paste into different wb | Excel Programming |