This is air code (i.e. untested) but you want something like this;
if rst is a DAO recordset, dbs is a DAO database variable pointing to your db, and strSQL is a string
' Assuming label_name...
Type: Posts; User: jeremybarker; Keyword(s):
This is air code (i.e. untested) but you want something like this;
if rst is a DAO recordset, dbs is a DAO database variable pointing to your db, and strSQL is a string
' Assuming label_name...
Over the years I've amassed a huge number of macros written in Office 2000 and 2003, and haven't had a problem running any of them under 2007/2010.
Of course, there are new things to get used to -...
[QUOTE=Maudibe;900872]Using the attached worksheet, click the "Copy Chart" button and a BMP of the chart will be created. Change the name of the chart (Chart1) and the destination path to suit your...
I've only had a quick scan, but you seem to be opening a recordset called MyRS, moving through each record, but not actually using any data from the recordset. As far as I can see, the info that you...
Yep - I can replicate the problem too! Most mysterious.
Would it be possible for you to upload a copy of the sheet so that we can have a play with it?
If you just want to process alternate columns of the selection differently, then you can check the column number of the cell variable to see whether it is divisible by 2 or not, using the mod...
I suspect they might contain zero-length strings.
If you amend your code to say something like
If cell.value = "" then cell.value = "0.00"
does this work?
I don't have any live query tables to practise on, but PT.RefreshTable is still valid syntax for refreshing a PivotTable. As an alternative, you could try the syntax PT.PivotCache.Refresh.
OK, in that case let's leave this thread if you're happy with the ideas you've got for your original problem, and keep updates to the other thread. If the guy who raised the original request is still...
So were there still problems with the Copy2 version you posted yesterday? I was actually lurking in that thread for a while but I thought you'd managed to sort the problem :)
I've never actually...
There isn't really a definitive list unfortunately, because when you're programming an end-user tool like Excel the "end-user" is pretty much free to change things how they want unless you impose a...
To be honest I could have condensed it even more - but I usually prefer to err on the side of readability, especially if I'm posting for someone else!
Note that both Andrew and I have skimped on...
Just as an alternative to Andrew's excellent macro, here is what was in my mind while I was pondering your problem before you uploaded the live file:
Sub JBDrill()
Dim ws As Worksheet
...
So are you saying that one week there are rows 9, 10 and 11 to process, and another week it might be rows 9, 10, 11 and 12, and the block of code you've included above would have to be repeated for...
I'm not entirely clear which bit of code you need to repeat, but if PT is a PivotTable variable then the property PT.TableRange1 returns an Excel range that includes the range of the PivotTable...
Hi Trevor - glad you found a solution that worked for you! Since we didn't have much context in the original post I assumed you needed to open the query as a recordset. If you ever need to do that,...
VBA's expression processor CANNOT parse references to form controls when they are buried within a stored query.
If your query is a simple one, then you can build the query dynamically like this:...
Not sure if this will help, but if you right-click the Pivot Table and select Pivot Table options or Table Options (not sure which version of Excel you have), is there an option that says Save Data...
Are you saying that certain records may not have the correct number of delimiters? This will give you a problem with automation, since it is easy to program the import and parsing of delimited...
Here's something I've lifted from an old database to get you started:
' import all the relevant ranges from the file into corresponding tables...
' parameters indicate: import or export,...
OK, simplest part first(!): I would suggest doing what I proposed and setting up a temp table e.g. tblTemp with the same structure as the main table to hold the imported records. I would also set up...
You haven't said which version of Access/Excel you have! Unless you have a really old version (pre 2002) you should be able to use Application.FileDialog to prompt for a filename using the standard...
I'm not at an Access 2003 machine at the moment, but presumably at the moment you have one (or more) tables displayed when you have the Tables tab selected in the main Access Window. If you click on...
I think RetiredGeek was trying to steer you towards creating a new Query based on the table, rather than applying a Filter/Sort to the table itself (which can get rather confusing if it gets saved...