Working with Ranges...Need help
Maybe...
dim myCell as range
dim myRng as range
dim myRow as range
set myrng = worksheets("Sheet99").range("A1:K12")
for each myRow in myrng.rows
if myrow.row mod 2 = 1 then
'odd numbered row, skip it
else
for each mycell in myrow.cells
if mycell.value = "" then
'update
mycell.value = "X"
'and stop looking
exit for
end if
next mycell
end if
next myrow
Jitranijam wrote:
If anyone could help me out it might save a bit of my hair. What I am
trying to do is work with a specific range (A1:K12). All of the Odd
row ranges A1,3,5,7,9,11 have text data in the cell that does not
change. The even rows are used as a sort of check list.
Example:
Column A B C D E F G H I J K
Row 1 AH BH CH DH EH FH GH HH IH JH KH
Row 2 X X X X X
Row 3 AH BH CH DH EH FH GH HH IH JH KH
Row 4 X
How do I get my userform command button to automatically first finish
looking for the available space on row 2 until there is no more spaces
and when K2 is filled with an "X" how do I get it to go to the next
line and loop through the range A2:K12? I have been putting the code
on the cmd_Click Sub. Then I want it to return a msgBox that says the
2 letters above the space. Can this be done and how?
Any help would be greatly appreciated.
Thank you
--
Dave Peterson
|