In Excel VBA (2003), I've noticed that any Public or Friend Sub method in either a module or ThisWorkbook that doesn't have any arguments will show up as a Macro that can be run by the user. I.e. when the user goes to Tools --> Macro --> Macros... (or Alt+F8) the method will show up in the list that can be run.
For sanity's sake (organ...
Using VBA in MS Office, how do I add text to the Windows clipboard so that it will paste into Word as a table?
...
Hi I am trying to do some maths with my VBA excel (prime factorization) and I am hitting the limit of the long data type (runtime error 6 Overflow).
Is there any way to get around this and still stay within VBA? (I am aware that the obvious one would be to use another more appropriate programming language)
Thanks for help in advance!
...
Hi,
When we use getstring to get data from a recordset(ADO) then it returns all the columns, if only particular columns are required then how do we modify the getstring statement?#
Thanks
tksy
...
I have a table in Access 2003 VBA with 164 columns but the data I get has 181 column and it is possible that it will get bigger in the future.
I need to know how to resize my table an to add extra colums during the runtime
I know how to check how many colums I need so I just need to know how to resize my own table.
thanks
...
Hi,
does anybody know how to save and retieve files in MS SQL-Server 2000? I guess the image data type could be used as a container.
I want to import/export the following file types: DOC, XLS, PDF, BMP, TIFF, etc.
Due to resource issues we are using MS-Access2007 as the front end, so I am looking for VBA code.
Thanks in Advance.
...
Good afternoon,
I have a web query in Excel 2002 going against a web page that returns a date column. The dates are returned as DD/MM/YYYY, as I would like to show them in my spreadsheet. My machine running Excel has its regional settings set to en-GB, and the only language set under Internet Options is UK English.
Nevertheless, the ...
I have a complex iterative spreadsheet in which I want to use a UDF to calculate the heat transfer coefficient of a heat exchanger. The function has 5 arguments (2 strings and 3 doubles). The strings and 1 double pass just fine. The remaining two don't seem to go through at all. A watch on problematic arguments shows them to be equal to ...
I am (unfortunately) developing an application in Excel 2000 VBA. I believe I have discovered that any error raised within a Custom Class property, function, or sub debugs as if the error were raised at the point in the VBA code where the property is called. That is, the VBE debugger does not take me to the point in the Class property ...
The code below works. But if I comment out the line "Dim objRequest As MSXML2.XMLHTTP" and uncomment the line "Dim objRequest As Object" it fails with the error message "the parameter is incorrect". Why, and what (if anything) can I do about it?
Public Function GetSessionId(strApiId, strUserName, strPassword) As String
Dim strPostData ...
I need to know how to add a custom, dynamic Autotext entry for Microsoft Word. I want to be able to Insert>Autotext>Header/Footer>"Last Friday" and have last Friday's date show up in the spot and keep it updated like inserting the Date Autotext updates each time the document is opened.
I have the VB code necessary to compute last Frida...
From the help for the Overflow Error in VBA, there's the following examples:
Dim x As Long
x = 2000 * 365 ' gives an error
Dim x As Long
x = CLng(2000) * 365 ' fine
I would have thought that, since the Long data type is supposed to be able to hold 32-bit numbers, that the first example would work fine.
I ask this because I have some...
Hello I am Tifu, I am using macros in excel 2007 for my work. I am working with many data and I need to sum data from 2 or more rows in the same coloumn according to the same month. However the month column is expressed as date.
for example, i have series of data
A B
2/10/2008 2
2/10/2008 3
4/10/2008 3
5/11/2008 ...
In other languages you can use strings as keys:
PHP:
$array['string'] = 50;
$array['anotherstring'] = 150;
Is this possible in VBA?
...
Hello,
When I perform the following code:
Dim italicSaveRange As Word.Range
Dim savedItalic As Variant
Dim someRange As Word.Range
Set italicSaveRange = someRange.Duplicate
italicSaveRange.Collapse (WdCollapseEnd)
savedItalic = italicSaveRange.Italic
someRange.Italic = True
italicSaveRange.Italic = savedItalic
I expected that any te...
hi
using macro i have consolidated info from several wbooks into on sheet in new book.
in one column i have created a named range called ColRange i have numbers ranging from -350 to 500 in this column
I can't seem to write the vba to color these cells red(0-500) yellow(-5-0)and green(-350--5)
any help would be appreciated
thanks
...
Good day all, I'm the "lead developer" for a major Excel based application that handles the production of a few mine sites. It talks to a bunch of databases, tries its best to help out users, and generally clunks along just fine through a mix of Solver, VBA, and in cell formulas.
Our development team is tiny and is composed entirely of...
We, like most companies enforce a branding policy on our outgoing literature.
This involves using different paper types etc, so we need to control the print process using a shared set of VBA routines stored in addin templates. One of the main problems we face is the nuances (such as hard coded tray enumerations) between different models'...
Given numbers like 499, 73433, 2348 what VBA can I use to round to the nearest 5 or 10? or an abitrary number?
By 5:
499 -> 500
2348 -> 2350
7343 -> 7345
By 10:
499 -> 500
2348 -> 2350
7343 -> 7340
etc.
Integrated Answer
X = 1234 'number to round
N = 5 'rounding factor
round(X/N)*N 'result is 1235
For floating point t...
Let say I have a sheet in with columns Customer and CreatedDate with lots of row with data. Anyone who knows how to setup (through VBA or Formula) a second sheet that displays rows from the first sheet based on certain where statements, i.e. all rows with customers "created this month." (similar to a select ... where query against a SQL ...