Finding next blank cell

J

JaiD

Hi,

Hopefully you can suggest how I can adabt my VBA Excel Sheet,

I have created a userform to input my work on and after i have entere
the details on the form i need it to enter it into my excel spreedshee
at the next available blank cell, problem is as i have formulas in th
right hand side of the row it picks them up and counts the cell as no
being blank and trys to find the next one i just want it to ignore th
right hand row.

Here's what I'm using:

Worksheets("Sheet1").Activate
Range("A5").Select
If Range("A5").Value = " " Then
Range("A5").Activate
Else
Range("A5").CurrentRegion.Select
ActiveCell.Offset(Selection.Rows.Count, 0).Activate
End If

Any suggestion would be great as pulling my hair out
 
B

Bob Phillips

IF you want the next blank cell in column A, try

Worksheets("Sheet1").Activate
If Range("A5").Value = " " Then
Range("A5").Activate
Else
Cells(Rows.Count,"A").End(xlUp).Offset(1,0).Select
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
R

RB Smissaert

Something like this might be do what you want:

Worksheets("Sheet1").Activate

If Cells(5, 1).Value = " " Then
Cells(5, 1).Select
Else
Cells(5, 1).End(xlDown).Offset(1, 0).Select
End If


RBS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top