Related:         
- Need some help whith vba
 - Vba case like - Guide
 - Excel online vba - Guide
 - Vba timer - Guide
 - Vba color index - Guide
 - Vba excel mac - Guide
 
4 responses
                
        
                    Excelguru
    
        
                    Posts
            
                
            261
                
                            Registration date
            Saturday April 11, 2009
                            Status
            Member
                            Last seen
            June 21, 2011
            
            
                    307
    
    
                    
Jul 20, 2009 at 11:28 PM
    Jul 20, 2009 at 11:28 PM
                        
                    Hello Da helpzor
Instead of using Range("I10") use cells(9,y) where y=10,11,... and change all cell references to this structure and increase y=y+1 after 1 iteration until activesheet.usedrange.rows.count
                
                
            Instead of using Range("I10") use cells(9,y) where y=10,11,... and change all cell references to this structure and increase y=y+1 after 1 iteration until activesheet.usedrange.rows.count
                
        
                    Excelguru
    
        
                    Posts
            
                
            261
                
                            Registration date
            Saturday April 11, 2009
                            Status
            Member
                            Last seen
            June 21, 2011
            
            
                    307
    
    
                    
Jul 17, 2009 at 05:15 AM
    Jul 17, 2009 at 05:15 AM
                        
                    Hello Da helpzor
To get the no. of rows & columns use
activesheet.usedrange.rows.count
activesheet.usedrange.columns.count
                
                
            To get the no. of rows & columns use
activesheet.usedrange.rows.count
activesheet.usedrange.columns.count
                        
                    hey there. i may be just me but i dont see wath you posted is gonna help me : / 
here is the code i got so far (yeh it is at an exprimental stage and im a beginner so it may look loco) as i posted i want it to be able to not onlye teste the content of column B10 agenst J9 and I10 but i want it to be able to cahange the cells it test the content agenst.
hope it is possible to understant waht im trying to achive.
Sub Loop1()
Range("B10").Select
Dim k As Integer
k = 0
For x = 1 To 100 Step 1
If ActiveCell = Range("J9").Offset(0 & k) And ActiveCell.Offset(0, 2) = Range("I10").Offset(k & 0) And ActiveCell.Offset(0, 3).Value > Range("j10").Offset(0 & k).Value Then
ActiveCell.Offset(0, 3).Copy
Range("J10").PasteSpecial
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
        
If IsEmpty(ActiveCell) Then
Range("B10").Select
End If
Next x
    
End Sub
            here is the code i got so far (yeh it is at an exprimental stage and im a beginner so it may look loco) as i posted i want it to be able to not onlye teste the content of column B10 agenst J9 and I10 but i want it to be able to cahange the cells it test the content agenst.
hope it is possible to understant waht im trying to achive.
Sub Loop1()
Range("B10").Select
Dim k As Integer
k = 0
For x = 1 To 100 Step 1
If ActiveCell = Range("J9").Offset(0 & k) And ActiveCell.Offset(0, 2) = Range("I10").Offset(k & 0) And ActiveCell.Offset(0, 3).Value > Range("j10").Offset(0 & k).Value Then
ActiveCell.Offset(0, 3).Copy
Range("J10").PasteSpecial
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End If
If IsEmpty(ActiveCell) Then
Range("B10").Select
End If
Next x
End Sub