I have a UserForm named "TotYrReturnsForm" with a CommandButton named "CloseButton"
The form is run in a Sub named "Enter_5Yr_Averages"
Within the Sub "Enter_5Yr_Averages", I have the following line code:
TotYrReturnsForm.Show vbModeless
This line code opens the "TotYrReturnsForm" UserForm...
I have used the "FormatNumber" VBA function to format Column 1 in a ListBox for numbers with four decimal points:
Area(1, j) = FormatNumber(Range(“A1”), 4)
If I wanted a different format for column 2 (e.g. six decimal points) this can easily be done with:
Area(2, j) = FormatNumber(Range(“A1”)...
I have several worksheets with matrices that I am trying to reference by using a summary worksheet. For example, I know I can do the following:
=INDIRECT($L$24&"!B10"); where L24 contains the worksheet name and this references Cell B10 for the Worksheet named in Cell L24.
What I am trying to...
I created a Pivot Table with multiple selections from a Report Filter. My question is once I make a selection is there any way to name the selection so I can retrieve the same selections from the Report Filter without having to remember and make the same selections each time? Any help would be...
I have a worksheet with several continuous areas that I would like to print on separate pages. For example, two adjacent print areas are as follows:
CR6:CU77, CV26:DM77
When I use VBA to enter the above into Page Layout/PrintArea, Excel combines the PrintArea to CR6:DM77. Is there a way I can...
I have a worksheet with several continuous areas that I would like to print on separate pages. For example, two adjacent print areas are as follows:
CR6:CU77, CV26:DM77
When I enter the above into Page Layout/PrintArea, Excel combines the PrintArea to CR6:DM77. Is there a way I can stop Excel...
I am trying to convert a 2002 Access Program to 2007. When I try to Save the open Database as Access 2007, I get the following message:
you attempted to open a database that is already opened exclusively by user 'admin'.
Any suggestions as to how I can convert or save the current database to...
I just converted to Excel 2007. The below code in a Visual Basic Module worked fine for Excel 2003, but now it PrintPreviews the worksheets but does not let me actually print or even close PrintPreview. I can scroll through the PrintPreview pages but everything else is frozen. I can only get out...
I just converted to Excel 2007. The below code in a Visual Basic Module worked fine for Excel 2003, but now it PrintPreviews the worksheets but does not let me actually print or even close PrintPreview. I can scroll through the PrintPreview pages but everything else is frozen. I can only get out...
I am using VBA to export Access data to an Excel Workbook. The VBA code includes the following:
Ans = MsgBox("Existing Data in " & xWkBkName & " will be replaced. Continue?", vbYesNo, "Data Replacement Warning")
If Ans = vbNo Then Exit Sub
When the program runs, the MsgBox is hidden by...
I thought that opening a Recordset based on a Query was identical to opening a Recordset based on a Table? Apparently not. The below works for Tables in my Database but not for Queries. Any suggestions as to how I can open a Recordset based on my Query named "QryTest"? Here is what I have that...
I have a List Box (lstBox1) with a "Requery" that populuates a second List Box (lstBox2). I am now trying to write code that loops thru all of the items in lstBox1 and runs the query that runs when an item in lstBox1 is "left-clicked". This is as far as I have gotten:
For i = 1 To NumList...
One of my main source of errors is trying to open a recordset when it is already open or trying to close it when it is already closed. Is there an easy way to check if a record set is open?
Thanks much for any help.
Jim
First, I apologize to anyone who may have seen this question on the Access Forum, where I posted this in error.
I am trying to use a VBA macro to set Excel's Print Range that varies each time the macro is run. The code looks like the following:
For i = 0 to 50
PrRng = PrRng & "," & "AI" & 2 +...
I am trying to use a VBA macro to set Excel's Print Range that varies each time the macro is run. The code looks like the following:
For i = 0 to 50
PrRng = PrRng & "," & "AI" & 2 + 175 * i & ":" & "AU" & 65 + 175 * i _
& "," & "AI" & 68 + 175 * iMkt & ":" & "AU" & 131 + 175 * i
next i
With...
This sounds like a simple question, but I do not know how to sum a range of numbers in an Excel Worksheet within a VBA subroutine. For example, assume Cells A2:B4 contain the numbers 1,2,3,4,5, & 6. How do I set a variable, say, X within a VBA subroutine such that X equals the sum of all numbers...
I am trying to set a TextBox's default value by using VBA code. Does anyone know how this can be done? I have tried the following:
Dim txtText1 As TextBox
Dim Val As Double
Set txtText1 = Forms!frmForm1.txtText1
Val = InputBox("Enter Value ", , 1.34)
txtText1.DefaultValue =...
Does anyone know how to sort through all open Microsoft Applications (i.e. Access and Excel Applications) to determine the "Title" of each such application?
Thanks much for any help.
Jim
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.