LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Begin and End Dates

Various factors might be at work here but the most likely
suspect is how you are storing the dates. The first thing
to check is the format of the column of cells containing
your dates: are these truly date values, or could they be
text? If they are text you will need to convert them to
true date values to make everything work.

Assuming you did take care of this, the next potential
problem is how you are referring to your dates in your VBA
code. Be sure to put everything into Date type variables
before you do any comparisons or filtering. Your
MessageBoxes are returning text so are you sure you are
converting the values properly to dates? I like using the
DateValue function for this purpose since it is easy to
use and mistakes can be easily seen and debugged.

As for AdvancedFilter, that is a pretty big topic and hard
to get into it without more specifics of what you want to
know. I don't think I would use Autofilter here, though:
I think I would just find the proper rows in the specified
date range and set that up as the source data range for
the PivotTable.

Hope this helps.

-----Original Message-----
I have tried this from multiple angles but have yet to

make it work.

I have a database of unknown size (between 3 and 30000+

entries) that are
sorted (or they have become sorted) by date.
I only want to put the relevant dates into the Pivot

table.
I want the user to enter the dates in a MsgBox type thing

because they can
be assured of putting them in the wrong cell.
The macro has to work without user input (except for the

dates) as I can not
be there with them.

I was trying to just step through the whole thing and

flag the rows that
enter/exit the defined date range but I can't seem to be

able to relate the
MsgBox date (date1 and date2) to the dates in the A

column. I can't get the
autofilter to understand my date1 and date2 (As Date)

either. Also the
advanced filter doesn't seem to work for me( everything I

have read about it
doesn't seem to relate to the advancedFilter I have.

Excel 2002)

A B C
01/14/2004 XXX YYY
01/15/2004 XXX YYY



.

 
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
Where to begin??? PointerMan Excel Worksheet Functions 8 January 2nd 09 09:12 PM
Sum Begin/End selectivity Dkline Excel Worksheet Functions 4 November 24th 08 08:06 PM
How do I begin value with the number zero? sportsandspeed Excel Discussion (Misc queries) 2 November 13th 08 01:27 AM
x-axis time series with 2 different begin dates tirrill Charts and Charting in Excel 5 April 25th 07 02:39 AM
how do i begin to use excel? AmberBrooks New Users to Excel 7 October 23rd 05 12:45 PM


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

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

About Us

"It's about Microsoft Excel"