Update DCount Criteria

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I have an excel database with over 4,000 records. Each month, I have
to run 100 reports based on this data. Currently, I am using multiple
DCount Formula to filter the data. My problem is I to manulaly update
one of the Dcount Criteria fields before I print the report.

Specifially, I enter 1 in the first cell within the DCount Criteia. I
than print a report based on this data. I then enter 2 in the frist
cell and print a report. I do this for over 100 reports. Is there a
way to automate this process?

Thanks in advance.
 
How about recording a macro when you do it once to get the range addresses
straight.

Maybe something like this:

Option Explicit
Sub testme01()

Dim iCtr As Long
For iCtr = 1 To 3 '100
Worksheets("sheet1").Range("b2").Value = iCtr
Application.Calculate
Worksheets("sheet1").PrintOut preview:=True
Next iCtr

End Sub

I left it as print preview and for 1 to 3--didn't want to kill too many trees
while testing.
 
Thanks. It worked perfectly.


Dave Peterson said:
How about recording a macro when you do it once to get the range addresses
straight.

Maybe something like this:

Option Explicit
Sub testme01()

Dim iCtr As Long
For iCtr = 1 To 3 '100
Worksheets("sheet1").Range("b2").Value = iCtr
Application.Calculate
Worksheets("sheet1").PrintOut preview:=True
Next iCtr

End Sub

I left it as print preview and for 1 to 3--didn't want to kill too many trees
while testing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Access Dcount (multiple criteria) 3
Access MS Access DCount function problem 0
Access Access Report Works on One Machine but not Another 3
Excel Need Countifs Formula Help 0
Dcount the values 0
very slow report with dcount() 6
Dcount operation 2
Dcount returning no results!!! 0

Back
Top