Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection of several records


Hi everybody,

I have this code which works on selecting the filled records startin
from the seventh row

It is working properly, but the problem with it is that it selects al
filled records even those which have zero value.

So, I would like you please to edit it to select records that hav
value greater than zero only.


Code
-------------------
Sub Select_Range()
[A7:J7].Select
Range(Selection, Selection.End(xlDown)).Select
End Su
-------------------


I hope that my question is clear for all,

Thank you sooooooo mcuh

--
LoveCandl
-----------------------------------------------------------------------
LoveCandle's Profile: http://www.excelforum.com/member.php...fo&userid=2861
View this thread: http://www.excelforum.com/showthread.php?threadid=48715

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Selection of several records

The value is in column A???

Then maybe something like this will give you an idea:

Option Explicit
Sub testme()

Dim myRng As Range
Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long

With ActiveSheet
FirstRow = 7
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row

For iRow = FirstRow To LastRow
If .Cells(iRow, "A").Value 0 Then
If myRng Is Nothing Then
Set myRng = .Cells(iRow, "A")
Else
Set myRng = Union(.Cells(iRow, "A"), myRng)
End If
End If
Next iRow

If myRng Is Nothing Then
MsgBox "Nothing to select!"
Else
'.select
Intersect(myRng.EntireRow, .Range("a:j")).Select
End If
End With

End Sub

LoveCandle wrote:

Hi everybody,

I have this code which works on selecting the filled records starting
from the seventh row

It is working properly, but the problem with it is that it selects all
filled records even those which have zero value.

So, I would like you please to edit it to select records that have
value greater than zero only.

Code:
--------------------
Sub Select_Range()
[A7:J7].Select
Range(Selection, Selection.End(xlDown)).Select
End Sub
--------------------

I hope that my question is clear for all,

Thank you sooooooo mcuh,

--
LoveCandle
------------------------------------------------------------------------
LoveCandle's Profile: http://www.excelforum.com/member.php...o&userid=28612
View this thread: http://www.excelforum.com/showthread...hreadid=487151


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selection of several records


Thank you very much,, That is really what I am looking for

--
LoveCandl
-----------------------------------------------------------------------
LoveCandle's Profile: http://www.excelforum.com/member.php...fo&userid=2861
View this thread: http://www.excelforum.com/showthread.php?threadid=48715

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
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Delete records when certain records have duplicate column data JVroom New Users to Excel 1 January 26th 09 06:23 PM
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
fraction of records matching filter selection not displayed in sta psbeddy Excel Discussion (Misc queries) 1 January 29th 07 02:06 AM
# of Records Shown During Auto-Filter Selection Rick Gomes Excel Discussion (Misc queries) 1 January 2nd 07 12:21 AM


All times are GMT +1. The time now is 02:41 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"