This may be too late to help, but there is a way to create a single event procedure for multiple controls. John Walkenbach explains how to do this on his "The Spreadsheet Page" website. Here is the link to the specific topic page: http://www.j-walk.com/ss/excel/tips/tip44.htm
The example...
Upon testing, I determined a slightly different max length (109) using Excel 2003 but regardless of the exact value, I don't know of any way to change that. It's likely a limitation of Excel itself.
Regards,
Mike
There is nothing wrong with your posted code, per se. I mocked this up and it worked as expected. The error you are getting indicates a problem with an object declaration/reference. I don't know what the rest of your worksheet and code looks like but my best guess is that MonthlyPayment is...
Groundhog,
Not to rain on your parade, but you might want to make sure those Visio dll's are legally redistributable. Should say so in the Visio documentation if they are.
Regards,
Mike
Not exactly sure what you mean. If you are creating subroutines, they will be placed in whatever module you select. If you mean macro recorder code, these are typically added to a new module, even if one already exists. Event procedures, on the other hand, are created in the appropriate...
Staying on the FileSystemObject bandwagon, the following will determine if a file exists:
Set FSO = New FileSystemOBject
If FSO.FileExists(FileSpec) Then ...
where FileSpec is the path + filename you are checking.
Regards,
Mike
mtroche,
I'm assuming you mean folders (directories) not files. Your code works for me if the path c:\X already exists (and the optional attributes parameter of the Dir function is set to vbDirectory). Otherwise, the MkDir call throws the "Path not found" error. In other words, MkDir can...
No, VBA does not include a design-time license for the component. However, your VBA application can still use the component but it must set any properties at run-time. I've used a DataGrid component in this fashion.
Regards,
Mike
Markus,
If you have code like Worksheets("Sheet1").Range("A1") in your macros, and you change the worksheet tab from Sheet1 to Calculation your macro will certainly choke. However, you should be able to do a Find/Replace to make the process of changing the sheet name in your code somewhat less...
Markus,
Yes! Many of the better Excel VBA programming books recommend this, since your macro code will break, otherwise, if the user changes a sheet tab name. Here's how:
In the Visual Basic Editor (VBE), select the worksheet your macro code interacts with from the Project window. Notice...
I'll give you the "standard" answer but this may or may not be the problem.
In the VBE, select Tools|References. In the dialog that displays you should see something like the following libraries checked (these are the minimum libraries that should be present):
Visual Basic For Applications...
As an alternative, you can modify your ComboBox to have 2 columns (use the Properties window in the VBE and change the ColumnCount property to 2). Use the following modified code to populate the Combo:
Private Sub UserForm_Initialize()
With ComboBox1
.AddItem "Steel"...
A couple of suggestions to try:
Change the line DirPath = "K:\current\" + ResultsDatetoDirPath = "K:\current\" & ResultsDate
& is the proper string concatenation operator in VBA
Inspect ResultsDate (while single-stepping through the code) for extra spaces. If that's the case, you can remove...
Expanding on cummings54's reply, here is some example code:
Sub GetFile()
Dim FPath As Variant
Dim FFilter As String
FFilter = "Comma Delimited (*.csv),*.csv"
FPath = Application.GetOpenFilename(FFilter, , "Select File To Open", "Open")
If FPath = False Then Exit Sub
'FPath contains...
ddaya,
Here is a procedure that will do what you want (explanatory notes to follow):
Const DATA_FIRST_ROW As Long = 2
Const DATA_ENTRY_COL As Integer = 1
Const DATA_CATEGORY_COL As Integer = 2
Const MAP_KEY_COL As Integer = 1
Const MAP_CATEGORY_COL As Integer = 2
Sub CategorizeFieldEntries()...
ddaya,
Just so I'm clear, confirm or correct the statements below:
A column on a worksheet contains a list such as
165T VCG Jul 05 - HK
4468 VCG Aug 05 - TOK
4019 VCG Aug 05 - AUS
266Q VCG May 05 - TOK
MTM V MTT diff
MTM adj
PWO Prov
BON Provision
CER provision
with each item in a separate...
ddaya,
Can you be more specific about what your data will look like, what the function should do and how you want to use the result. Post some sample data (several cells worth). Also, how will you use this in conjunction with VLookup?
Regards,
Mike
Michelle,
You don't say what trouble you are having. Assuming the underscore johnwm pointed out is a typo, I'm guessing the problem is that VLookup is not returning the expected ("correct") value. If that's the case and assuming your data is not in sorted order, then you need to tell VLookup...
Not sure which application you are using, but from the Excel VBA Help file:
AutoTab Property
Specifies whether an automatic tab occurs when a user enters the maximum allowable number of characters into a TextBox or the text box portion of a ComboBox
and in the Applies To list:
ComboBox Control...