Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default searching for a time range in Excel

Hi,

I have around 10 thousands rows of data with Date and Time.

My plan is to search mark/list out all the the rows with time running
from 3am to 6am of the day.

What will be the easiest way to do it in VBA?

Please advice and thanks in advance.
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default searching for a time range in Excel

edvwvw wrote:
Hi,

[quoted text clipped - 6 lines]

Please advice and thanks in advance.


One very quick way would be to conditional format A1 using between 03:00 and
06:00
( I have presumed that the cells are in time rather than text format)

Then click on the cell between A and 1 to highlight the whole sheet, then
paste special format

The cells that meet the conditional format will be highlighted.

If you want it in VBA you could carry out the steps while recording a macro

edvwvw



If you want it in VBA

Sub Times()
Set rng = Worksheets(1).[a1]

Cells.Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:="0.125", Formula2:="0.25"
Selection.FormatConditions(1).Interior.ColorIndex = 19

Range("A1").Select


End Sub

--
Message posted via http://www.officekb.com

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default searching for a time range in Excel

On Jun 13, 9:57*am, "edvwvw via OfficeKB.com" <u42512@uwe wrote:
edvwvw wrote:
Hi,


[quoted text clipped - 6 lines]


Please advice and thanks in advance.


One very quick way would be to conditional format A1 using between 03:00 and
06:00
( I have presumed that the cells are in time rather than text format)


Then click on the cell between A and 1 to highlight the whole sheet, then
paste special format


The cells that meet the conditional format will be highlighted.


If you want it in VBA you could carry out the steps while recording a macro


edvwvw


If you want it in VBA

Sub Times()
Set rng = Worksheets(1).[a1]

* * Cells.Select
* * Selection.FormatConditions.Delete
* * Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
* * * * Formula1:="0.125", Formula2:="0.25"
* * Selection.FormatConditions(1).Interior.ColorIndex = 19

* * Range("A1").Select

End Sub

--
Message posted viahttp://www.officekb.com- Hide quoted text -

- Show quoted text -


Thank you very much, now I have another question, how do I loop
through all these highlighted items, as I have further investigation
on these items.

  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default searching for a time range in Excel

On Jun 13, 11:31*am, "edvwvw via OfficeKB.com" <u42512@uwe wrote:
wrote:
Hi,


[quoted text clipped - 34 lines]


- Show quoted text -


Thank you very much, now I have another question, how do I loop
through all these highlighted items, as I have further investigation
on these items.


It depends what you want to do - if you want to make anamenment to the times
then the macro will need to be written in a different way.

I haven't got time today to look at it for you - maybe someone else will help

edveve

--
Message posted viahttp://www.officekb.com


Once I filtered all the "times", I then have to look into other
columns. But I might still need to look at rows before or after the
3am or 6am frame.

So that's why I need to see all rows, but have the ability to loop
thru only the filtered rows and refer to other rows before or after
the filtered ones
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
SEARCHING RANGE Mickey Mouse[_3_] Excel Discussion (Misc queries) 4 April 12th 08 05:19 AM
Searching a range with MS Query dsb Excel Worksheet Functions 3 November 1st 06 11:04 PM
searching a range for a sum... chickenshed_bob Excel Worksheet Functions 4 March 30th 06 08:49 PM
Searching a Range for a number over 40 annem Excel Worksheet Functions 2 January 6th 06 03:59 PM
3d range searching thephoenix12 Excel Discussion (Misc queries) 0 June 15th 05 06:18 PM


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