I am able to add controls to a form when it is loaded. I need these controls to be to be catagorized so the user only can see a few at a time. My first thought was to attached the controls to particular tabs. Not sure why the syntax is off in the following code. Thanks for the help!
Private Sub Enter_Records_Click()
Dim stDocName As St...
In Excel VBA, I redefine the address of a named range with:
Ranges("MyRange").Cells(1).CurrentRegion.Name = "MyRange"
in the Worksheet_Deactivate event.
This way, after updating the spreadsheet, MyDataRange always references to the entire data.
Ok with Excel, but when I tried to migrate this to Open Office VBA (OpenOffice.org 3.1.1 /...
Hi,
I have three questions about VBA and controlling/manipulating new windows.
I have several sheets set up.
Master | Worksheet1 | Worksheet2 | Notes | Work Orders | Contact Info
1) I have WorkSheet_Activate functions set up on Notes, Work Orders, Contact Info that open up all three sheets in seperate windows and arrange them vert...
How to remove the recent document history in Excel Ribbon using VBA.
I am using the code below, but it doesn't seems to work.
Sub Button1_Click()
For i = 1 To Application.RecentFiles.Count - 1
Application.RecentFiles(i).Delete
Next i
End Sub
Thanks ...
...
I am totally new to VBA (aside from recording and running manually) so was hoping somebody could help me with designing this. I have a worksheet with unspecified # of rows per unique ID (column A), based on date and type. :
A B C D
1 12Jan2010 type A Person1
1 16Jan2010 type B Person1
...
Microsoft Excel – How to copy cells to a different worksheet on every nth row.
I have an interesting problem. It is probably simple, but I can’t figure it out.
I have a list of cells (about 10 columns across and over thousand rows, soon to be expanding)
A1-A10 and down
These are my headings and main input cells (let’s call this Summary...
Question: I am wondering which is the optimal solution for dealing with Arrays in Excel 2003 VBA
Background: I have a Macro in Excel 2003 that is over 5000 lines. I have built it over the last 2 years adding new features as new Procedures, which helps to segment the code and debug, change, or add to that feature. The downside is tha...
I am splitting a line of text into an array then attempting to put into a new array without the null spaces. For some reason it's not copying from the old array into the new one. BTW if someone has a more efficient way of doing this I am open to that as well.
Dim x As Variant, i As Integer, m As String, rdate As String, k(0 To 50) As V...
We generate HTML from text in an Excel spreadsheet. The text contains unicode representations of international characters. When we use VBA to extract the text and output it to a file, it is written as ANSI (ASCII). Is there a way to preserve the unicode representation using VBA?
Bruce
...
Hello,
Application.Run "MyWorkBook.xls!Macro1"
will work (run the macro called Macro1 in the MyWorkBook.xls file)
Application.Run "My Work Book.xls!Macro1"
will not (if the workbook name contains spaces, Excel says "the macro cannot be found").
I just spent hours figuring out that it's the spaces causing this problem...
Is there ...
Hi,
I have 2 sheets sheet1 and sheet2 in an excel 2007 file.
In sheet2 I have a column that is managed by a form/macro(with a tree view control). When an element has been selected, the cell is filled with an "x", when it has been unselected, the cell is filled with "" (nothing).
In sheet1 I want to create a column equal to the sheet2 ...
So I have a form that has a list box and several buttons that run sqk statements for the list box.
sub on_onClick()
' error checking
me.listbox.rowsource = "SELECT tblMain.First, tblMain.last FROM tblMain ORDER BY tblMain.Last;"
so this kinda thing is what I use for the list box. it works fine for me in the .mdb, and after i have co...
I've recently taken it as a project to teach myself how to program in Python. Overall, I must say that I'm impressed with it.
In the past I've typically stuck to programming in VBA mostly for MS Excel (but also a bit in MS Access and Word) and have struggled to find ways to make it do things that Python can easily do with a single comm...
I have a weird situation where I have a set of excel files, all having the extension .xls., in a directory where I can open all of them just fine in Excel 2007. The odd thing is that I cannot open them in Excel 2003, on the same machine, without opening the file first in 2007 and going and saving the file as an "Excel 97-2003 Workbook"....
I would like to write some custom VBA functions to perform calculations on particular fields in a set of queries. This is what I currently have:
Public Function TVM(LEN_SEC As Double, ADT_CUR As Integer, TRK_PCT As Integer)
TVM = LEN_SEC * ADT_CUR * TRK_PCT / 100#
End Function
This works fine, but when I create the query I have to...
ORIGINAL QUESTION (How can I display images from a MySQL database in an Access 2007 form?)
I would like to use Access 2007 to interface to a MySQL database and display pictures and other data in a form.
I already have an Access 2007 application that I don't want to change much, if I can help it. I'm just not sure what data type will w...
I am using microsft excel 2003. I am getting "Application-defined or object-defined error" while executing the following If statement.
If Range("MyData").CurrentRegion.Offset(i, 0).Resize(1, 1).Value = Range("MyData").CurrentRegion.Offset(i + 1, 0).Resize(1, 1).Value Then
The value of i is 58981 when I get this er...
This is my function:
Public Function DBConnection(ByVal path As String)
' This function makes the database connection and returns the object
' to reference it.
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + path + ";")
cn.Open()
Return cn
End Function
As you can see, I want to initializ...
I have a macro that I use to receive data from an InputBox and then insert that data into a cell. I am having some formatting issues with the data after the following macro runs.
Sub InsertNotes()
'
' insertnotes Macro
'
'
Dim UserNotes As String
UserNotes = InputBox(Prompt:="Please enter your note below:", Title:="Note input"...
I'm trying to connect to a Lotus Notes database via VBA in Microsoft Access 2003. The code I have is as follows:
Set nSession = CreateObject("Notes.NotesSession")
Set nDatabase = nSession.GetDatabase("CN=MT_N01/O=Org Name", "LossPrevention\BrchPrVI.nsf", False)
I've tried variations for the server name, but nothing seems to work. In...