PC Review


Reply
Thread Tools Rate Thread

Anyone know what's happening with this bit of basic?

 
 
kirkm
Guest
Posts: n/a
 
      7th Nov 2006

---
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)

Dim rng As Range
Dim MyLastRow As String
Dim MyLastCol As Integer


Set rng =
Worksheets("mySheet").Range("A1").SpecialCells(xlCellTypeLastCell)
MyLastRow = rng.Row
MyLastCol = rng.Column



Rows = "G1:G" & MyLastRow

If Not Intersect(Target, Range(Rows)) Is Nothing Then

Stop
End If

End Sub
---

What is supposed to happen (and sometimes does) is, if you
double click a cell in column G, it should stop at the Stop statement.

Otherwise it should do nothing.

But sometimes (and right know every time) it overwrites all the cells
with
"G1:Gxxx "and trashes around with the hard drive for ages. Eventually
I hit the reset buttion in disgust, and I can load the xls backin,
with all back to normal, until I click col G again.

I also can't step through it or figure what the probelm is.

Thanks - Kirk
 
Reply With Quote
 
 
 
 
kirkm
Guest
Posts: n/a
 
      7th Nov 2006
I figured it out.

'rows' needs to be dimmed. Must be a system name or command.
 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      7th Nov 2006
Rows is the name of a VBA Property. Do NOT use it as a variable name. Choose
something else.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com
(email address is on the web site)

"kirkm" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I figured it out.
>
> 'rows' needs to be dimmed. Must be a system name or command.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic way to make basic databases work on Access2007? Fred Microsoft Access 5 8th Apr 2010 04:47 PM
have window vista basic.understand basic don't have fax & scan jay sureka Windows Vista Print / Fax / Scan 4 7th Jan 2008 07:02 PM
Basic Difference between Visual Basic 6 and Microsoft Access VBA =?Utf-8?B?SXJzaGFkIEFsYW0=?= Microsoft Access 2 5th Apr 2007 12:34 PM
i have office basic 2003,does IRM work with basic? =?Utf-8?B?T29sYQ==?= Microsoft Outlook 6 7th Jun 2006 06:09 AM
please I need help with basic ado.net save, basic syntax needed =?Utf-8?B?TmV3YmVlIEFkYW0=?= Microsoft Dot NET 5 28th Jun 2005 07:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:33 PM.