Code modification help please

C

Chris Hankin

Hello,

Could some one please help me modify the following vba code so that I
can enter string-text into column A instead of a long-number?

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Dim lrowA As Long
Dim lrowH As Long

lrowA = Cells(Rows.Count, "A").End(xlUp).Row
lrowH = Cells(Rows.Count, "H").End(xlUp).Row

If lrowH < lrowA Then
For i = lrowH + 1 To lrowA
Cells(i, "H").FillDown
Next
End If

End Sub

Any help would be greatly appreciated.

Thanks,

Chris.
 
J

JE McGimpsey

Not sure what you mean - this code doesn't prevent using text in column
A. It wouldn't require longs in any case - all numbers in XL cells are
doubles.

What is the problem you're experiencing?
 
C

Chris Hankin

Hello JE McGimpsey, thanks for your reply. The problem I was
experiencing was that my spreadsheet was 'protected' and thus causing a
run-time error '1004'. I have left my spreadsheet 'unprotected' and am
able to populate text into column A.

Kind regards,

Chris.
 

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