Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Evaluating a group of cells John Excel Discussion (Misc queries) 3 July 10th 08 02:53 PM
evaluating text of cells [email protected] Excel Discussion (Misc queries) 1 January 22nd 08 07:03 PM
Evaluating Empty Cells halem2[_36_] Excel Programming 0 October 6th 04 09:21 PM
Evaluating Empty Cells halem2[_35_] Excel Programming 3 October 6th 04 07:41 PM
Loop cells - get all rows with matching data - paste into different wb Buffyslay_co_uk Excel Programming 2 July 23rd 04 01:20 PM


All times are GMT +1. The time now is 01:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"