Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Code modification help please

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.



*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Code modification help please

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?

In article ,
Chris Hankin wrote:

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.



*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Code modification help please

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.

*** Sent via Developersdex http://www.developersdex.com ***
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
modification to this code James Excel Discussion (Misc queries) 0 March 23rd 09 09:20 PM
Code modification help AndyMP Excel Worksheet Functions 1 February 8th 09 11:41 PM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM
modification for the code srinivasan Excel Programming 2 August 20th 05 03:12 PM
Code Modification Todd Huttenstine Excel Programming 1 March 7th 04 03:54 AM


All times are GMT +1. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"