hunna
12-09-2011, 05:04 AM
I am trying to write a code that runs certain macros until the last used cell in column A. The code is not working could anybody help me with this?
Sub ds()
Dim i As Integer
Dim intRowCount As Integer
intRowCount = Range("A2").CurrentRegion.Rows.Count - 1
For i = 2 To intRowCount
If Not Cells(i, 1).Value = "" Then
TextBox1.Value = Cells(i, 1).Value
TextBox2.Value = Cells(i, 2).Value
TextBox3.Value = Cells(i, 3).Value
TextBox4.Value = Cells(i, 4).Value
If Not Cells(i, 7).Value = "" Then
MsgBox "modification"
Else
MsgBox "No modification"
End If
Else
MsgBox "try again"
End If
Next i
End Sub
any help is greatly appreciated.
Sub ds()
Dim i As Integer
Dim intRowCount As Integer
intRowCount = Range("A2").CurrentRegion.Rows.Count - 1
For i = 2 To intRowCount
If Not Cells(i, 1).Value = "" Then
TextBox1.Value = Cells(i, 1).Value
TextBox2.Value = Cells(i, 2).Value
TextBox3.Value = Cells(i, 3).Value
TextBox4.Value = Cells(i, 4).Value
If Not Cells(i, 7).Value = "" Then
MsgBox "modification"
Else
MsgBox "No modification"
End If
Else
MsgBox "try again"
End If
Next i
End Sub
any help is greatly appreciated.