How to pass variable to a Sub
Private Sub Worksheet_activate()
X = Sheets("DATA").UsedRange.Rows.Count
I would like to pass the value of X to WhatEver Sub.
How can I do that?
Message posted from http://www.ExcelForum.com
You can pass variables directly in the Run method. E.g.,
Application.Run "WhatEver", X
Microsoft MVP - Excel
Pearson Software Consulting, LLC
"alainB >" <<alainB.email@example.com> wrote in
message news:alainB.15f339@e...I am attempting to find the difference between two dates...
I am attempting to find the difference between two dates (in terms of days,
months, and years) but I always get an additional month added on. Why? And
how can I fix?
For instance, if I want to find the difference between 1/1/2010 and
2/1/2010; it returns 2/0/0
Have a look at Chip Pearson's explanation of DATEDIF
=DATEDIF(A1,B1,"y")&" years "&DATEDIF(A1,B1,"ym")&" months
be careful ewith this because it can throw up...Certificate blues
I've bought a GlobalSign certificate described as "Organization
ServerSign with SAN" for marrian.com (my internet domain). The email
delivering the certificate included text for the "SSL" certificate and
text for the "OrganizationSSL Root" certificate. Following
instructions, I created two crt files and installed them on the
server. I can see the certificate under the Personal folder but it
shows as marrian.com whereas perhaps I need to get it reissued as
remote.marrian.com? Also following instructions, I ran this command in
the Exchange Management She...using old Gift certificates on our new RMS
Ok, I have just transfered to RMS from another POS system. We couldn't
export our old gift certificates to the new RMS, but they are still out there
and being redeemed. The problem is they have already been sold and we need
them in our system. We have tried a discount on a sale, but that only takes
money off the sub total and shorts the taxes owed on the total. How do we get
our old gift certificates in our new system without taking in money and
effecting our bookkeeping, and having allowing our customers to use them. We
also tried to enter them as vouchers and in a payment optio...Passing value to bound control on subform
I have a form with 4 subforms in a tab subform control. I generate a
purchase order number in the parent form with I want to use to set the
value of a bound control on one of the subforms. I thought this
should be easy but I'm have trouble getting it to work.
Link the two fields in Master/Child links. These are properties of the
subform control. So the Parent field is the master, the subform field is the
> I have a form with 4 subforms in a tab subform control. I generate a
> purchase order number in the parent form with I want to use to...How to Load a String, passing in the ID of the resource, not the name?
I would like to get the Caption for a String, from the String table,
by passing in the value of the String, not the ID of it.
For example, the String in my String table is:
(Caption) This is the text of the example
But I have many different strings in this table and in my code I want
to be able to get the String by passing in the int value of the
resource but I don't know how to do this?? (ie I want to pass a
variable such as 105, 1o6 etc to a function, not the IDS_STRINGTABLE
I know CString::LoadString(IDS_STRINGEXAMPLE) will give me what I...Passing a value in VBA using an offset
I have code that executes when I double click on a cell. The code
inserts the data validation source into a combobox to ease the input
choice. It refers to the cell I double clicked as "target"
I want to add a new feature. Before anything else happens, I want to
filter the data validation source (many of the entries are for dates
that don't apply. the cell above "target" has a date. I want to copy
the month of that date into a fixed cell ("A1") and then use that date
in an advanced filter on the data validation source. Hope you're with
me so far.
T...CRM Certification 04-14-04
I am interested in pursuing MS CRM certification for all
three 1.2 tests currently available. Does anyone have any
recommendations for prep for these exams? I am the in-
house database administrator but we brought in an
outsource consultant for our CRM deployment prior to my
coming on board. I have picked up a bunch of the
technical specifics but there are gaping holes in my
I also purchased the 'Using Microsoft CRM' by Brown &
Gravely as well. I did notice that MS is offering E-
Courses in the requisite areas of certification for
between $350 and $550 a pie...Problem with IIS and client certificate
I can not run a client certificate. happens that when we implement the
sigiente form does not work.
Windows Server 2003 with Certificate function
Clients can not download the certificate giving to add staff.
this tell you;
The page Require a client certificate
The page you are trying to view Requires the use of a client certificate.
HTTP 403.7 - Forbidden: Client certificate required
Internet Information Services
We use this note, but only works if the web server and cetificado is the
www.windowsecurity.com/.../Client-Certificate-Auth...pass through parameter
I think this may be answered in other questions, but I'm unable to tease it
I've a pass-through query
mem.MEME_FIRST_NAME||' '||mem.MEME_LAST_NAME Member,
from hprpt.cmc_meme_member mem
inner join hprpt.cmc_sbad_addr addr
on mem.SBSB_CK = addr.SBSB_CK
group by mem.empi,
mem.MEME_...Sorting of worksheet, half of columns are formulas referring to 1st worksheet...
I want to sort my worksheet alphabetically by last name. Half of my
worksheet columns contain contact information that are formulas
referring to another worksheet in the file. The other half is regular
values of dates in different columns. (We use the file to track
correspondence). I added 100 more rows to the worksheet.(about 300
total). Now I need to sort, but everything I try results in the rows
getting switched around. Ex: Dr. Smith's dates aren't correct.
They're on Dr. Smyth's row. Dr. Smith has Dr. Snyder's dates. Any
I am about to sit the Excel Expert 2003 MOS Exam. Has anybody already sat
this and, if so, do you have any tips for me???
(Is there a discussion group anywhere specifically for MOS? I can't find
I took it yesterday. You can go to www.cramsession.com and sign up to
download a study guide. However, a word of warning. I found a number of
mistakes in it. Specifically, the FV and PMT functions are not correct; the
3d formula is missing a step; and the filter to show all the employees in two
locations should be 'or' instead of 'and'...a WHITE BORDER IS LEFT WHEN i ATTEMPT A FULL COLOR BACKGROUND
Either in Word or Publisher, when applying an entire page color background, I
am always left with a white border on the page. How can I get the entire page
backgrond to print?
Could be your printer's margin limitations
Tutorial: Finding your Maximum Print Area
Mary Sauer MSFT MVP
"David Gauthier" <David Gauthier@discussions.microsoft.com> wrote in message
news:D1390ACA-6...Passing Array to sub as parameter
Hi to all,
I am trying to pass an array as a parameter to a sub to finish populating a
opened recordset but I get an error of "subscript out of range" fix it but
not quite sure, and the second error is a type mismatch, can anyone tell me
what is wrong here
PS. I need to build 12 subs to I do not have to manipulate the code if a
fiscal yr is changing
Private arrSngMth() As Variant declared at top of module
Private Sub BudAvrMar(rst As DAO.Recordset, rst2 As DAO.Recordset, sngInc As
Single, ParamArray arrSngMth() As Variant)
'rst = main data recordset
'rst...Passing ref type to methods using invocation within Powershell
In the code below [my5.stuff]::EnumDisplayDevices($null,1,[ref]$test,0)
does not work because the $null is cast as ""
The following line does return true but $test is not populated with the
Presumably this is because [my5.DISPLAY_DEVICE]$test is not a reference
HOW CAN I PASS A REFERENCE TYPE TO THE INVOKED METHOD SO THAT $TEST IS
POPULATED WITH THE DETAILS FOR DISPLAY DEVICE 0?
I have tried all sorts of different ways can cann...How to pass IDispatch of Font to COM Object?
I have a Grid control that is written in VB. I am adding this control in my
MFC Dialog appl.
This control has a function that takes arguments like
[id(0x60030057), helpstring("Sets multiple format details for a cell at the
same time. Quicker than calling the properties individually.")]
[in] long lRow,
[in] long lCol,
[in, optional] VARIANT sText,
[in, optional, defaultvalue(262176)] ECGTextAlignFlags
[in, optional, defaultvalue(-1)] long lIconIndex,
...Access pass-through query to Oracle 10g stored procedure
I am able to create an Access 2003 pass-through query to Oracle 10g that uses
a SELECT statement; it returns a resultset. But, I cannot get a resultset
when I try to execute an Oracle stored procedure in a pass-through. I set the
stored procedure up with a SYS_REFCURSOR in it. The SP must have a reference
cursor to return the resultset. How do I execute this in Access 2003? I have
used the following syntax with IN date parameters: EXEC
HREMPINFO('1-Jan-1900', '31-Dec-2005'); I also tried putting the name of the
parameter between a begin...end block in the pass-thr...Outlook shuts down when I attempt to retreive email
Outlook shuts down when I attempt to retreive email, It
allows me to send but not reteieve, can you help?
Try deleting the SRS file at C:\Documents and Settings\username\Application
Data\Microsoft\Outlook. You can easily access it by pasting
%USERPROFILE%\Application Data\Microsoft\Outlook in the Address bar of your
browser or Windows Explorer.
Diane Poremsky [MVP - Outlook]
Author, Teach Yourself Outlook 2003 in 24 Hours
Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide)
Author, Google and Other Search Engines (Visual QuickStart Guide)
Outlook...Passing events form dll to c#
My C# program calls, trough some sort of wrapper, DLL functions of a text to
speech engine. This (dll)wrapper also provides information about the state of
the engine (start event, word event, stop event).
Is it possible to route these events directly to my program, so I do not
have to poll them frequently? The wrapper code can be modified without any
Thanks in advance.
I think you have to manually convert the dll classes to your site's
app_code directory, from where you can access them and modify them..
Hope this helps..
Ma...stencils + shapesheet code + certificate??
I am running visio 2002.
I have put some code into shapes on my stencil.
In the Actions area I have put the code =RUNADDON("thisDocument.M1")
which M1 is in my document.
I can sign the visio document code to be trusted.
However I get a warning for the stencil that gets opened up.
Is there a way to sign the code on the stencil?
thanks in advance
...MOS Core exam
Has anyone had this experience? I know for a fact that I answered everything
correct on the Excel exam yet only got 900. A few folks in the office had the
How do you know you answered everything correctly, when I took it I thought
obviously that I did but I did not and I accepted that I intepreted some
questions differently? Besides it is of no use really, no real excel skills
are tested, just run of the mill. It might look nice on a resume but frankly
an exam which you can basically look up answers before hand is not worth
much to me (one can buy boo...Setting up 1st Macro
I am trying to set up a Macro to export payroll data from one worksheet to another so the 2nd worksheet doesn't have names associated with payroll figures. I am having trouble--I get a bug/error whenever I try to copy/paste a cell from 1 worksheet to the next, and I don't know if I need to do something w/ the 'relative reference' tool or not
as always :-)
please post your current macro. Otherwise it's quite complicated to
locate the error
> I am trying to set up a Macro to export payroll data from one...ANN: U.S.Congress passes a very tough Iran Sanctions Bill!
Obama will most likely sign this bill which cracks down on u.s.a.
companies doing business with iran!
p.s. the u.s. house passed the bill 408-8 and the u.s. senate passed
the bill 99-0 so the votes are there 2 overide a veto if needed! just
...First attempt at VBA coding problem
I have a formula in a cell on a worksheet as follows:
=TEXT(DAY(B5),"00")&"-"&TEXT(MONTH(B5),"00")&"-"&RIGHT(TEXT(YEAR(B5),"00"),2)&"," & CELL("contents",D5)&""
I am attempting to automate entering the formula in a cell with the
following macro code. Obviously I have something wrong with the syntax. Can
anyone identify the error in this code:
ActiveCell.FormulaR1C1 = _
"=TEXT(DAY(RC),""00"")&""-""&TEXT(MONTH(RC),&...printing a certificate
why does my border not show in print preview or when i print?
printing a certificate <printing a
firstname.lastname@example.org> was very recently heard to
> why does my border not show in print preview or when i print?
How close is it to the edge of your paper?
Ed Bennett - MVP Microsoft Publisher
not very close...now when i try to print it says publisher doesn't support to
special paper option for outside printing
"Ed Bennett" wrote:
> printing a certificate <printing a
> email@example.com> was very recently h...