View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mario_Party Mario_Party is offline
external usenet poster
 
Posts: 1
Default Finding blank cell


Code:
--------------------
Private Sub CommandButton2_Click()

Dim i As Integer
Dim PurchaseID As String

If Sheets(1).Range("B1").Value = "" Then
MsgBox "Please enter a Member ID into highlighted cell B1", vbOKOnly, "Enter Member ID"
Exit Sub

Else

i = 1
Do Until PurchaseID = ""
PurchaseID = Sheets(3).Range("A" & i).Value
i = i + 1
Loop

Sheets(3).Range("A" & i + 1).Value = i

End If
End Sub
--------------------


I currently have this code, but first let me explain the situation.

On sheet1 there is are two command buttons, the first is fine but this
second one will function to do something else.

The code I have posted above is that of the second button. In sheet 1
I have the user enter some simple data, but I want some of this data to
be retained and logged into sheet3.

What I need to do is work out where the next blank row is in sheet3,
but the code above isn't working - all it does everytime is return the
second row - even though there is something in the second row.


--
Mario_Party
------------------------------------------------------------------------
Mario_Party's Profile: http://www.excelforum.com/member.php...o&userid=30925
View this thread: http://www.excelforum.com/showthread...hreadid=506008