216,491 questions
0
votes
0
answers
45
views
Anchor a Column Reference in VBA, Cells method
In this VBA formula, I need to anchor the variable wsPrice_Col2's column so when I add other columns with formulas, this column reference stays the same. Currently the wsPrice_Col2 column reference ...
0
votes
0
answers
31
views
Access 2016: Selecting a record in a datasheet when form is loaded
My problem relates to selecting a record in a datasheet-subform in Access 2016.
(Note: I have fixed this problem using a form timer which runs once after opening, but I don't think this is an ideal ...
1
vote
0
answers
35
views
VBA Power Query refresh
I need to refresh the PQ data before copying and pasting reports.
When I launch PQ for the first time, it only generates one report. This is incorrect because reports should be created based on the ...
0
votes
0
answers
65
views
Why does this function throw #VALUE errors? [closed]
This code is for a function, "Compound," that tries to return the interest accumulated for a starting investment (P) on a specific date (when), using a specific interest rate (r), and a ...
0
votes
0
answers
42
views
Excel move VBA WinHttpRequest to Script Fetch fails Failed to fetch at self.fetch
We use an API call to a custom site run by another company. The calls require a token to be generated first and passed along. The following code to generate a token works with no problem in VBA:
Dim ...
-2
votes
0
answers
40
views
Split a row in Word table with vba [closed]
A row in a Word table should be split at the cursor Position with VBA. And the text around the cursor should split accordingly. As when I draw a line with the table drawing tool.
I know how to insert ...
0
votes
0
answers
103
views
Type Mismatch Error When Providing String Value to CustomOrder Parameter in SortFields.Add Method If CustomOrder Value Not Wrapped In CStr() [duplicate]
I have a section of Excel VBA code that worked during prior attempts, but suddenly threw a Type Mismatch error. I confirmed the error was caused by the CustomOrder parameter by removing it and ...
2
votes
1
answer
85
views
Hiding columns in Excel based on cell value using VBA macro doesn't work if cell value is result of formula
I know very little/next to nothing about Excel macros. Just so you know where I'm coming from.
I tried searching for a way to hide/unhide columns based on the text value of a reference cell, and found ...
0
votes
3
answers
71
views
Incorporate existing HTML file as String in VBA and send as HTML email using Outlook?
I am trying to incorporate a html file as a part of a new email (in the email body section) using outlook.
Here is my code:
Dim OutlookApp As Object
Dim OutlookMail As Object
' Define the range ...
0
votes
0
answers
81
views
MS Access Exporting Excel file formatted in a way different than what is saved and date in the wrong format
I have setup an MS Access database which handles information imported then exported to an Excel spreadsheet.
Previously the exports were done through the saved exports within MS Access but it required ...
2
votes
3
answers
105
views
How to use VBA to populate one column based on another column in excel
I have an excel sheet with a bunch of vehicles in a column, and I want to populate a new column with the "type" of vehicle.
Here's a quick screenshot.
Or to save you a click it's like this:
...
0
votes
1
answer
121
views
Can't create tables automatically in Word document from Excel VBA
I'm trying to create a Word document from an Excel workbook. It loops through a number of sheets creating one page in Word per sheet in Excel. Creating basic text works just fine. It's when I try to ...
3
votes
3
answers
108
views
How to fix "cannot run the macro" error for a macro in an addin
I am having trouble launching subroutines from an add-in via the Quick Access Toolbar (QAT). Over the past year or so, with various versions of the add-in, I have had some successes and many failures, ...
0
votes
2
answers
125
views
Use Stream to connect to MS-Word docs in SharePoint and copy contents to local MS-Word doc
I have MS-Word Document templates that are stored in SharePoint. I need to write a sub within an Excel file to reach into SharePoint, copy the contents of the word document(s), and save to a local ...
7
votes
2
answers
219
views
Bug in Excel VBA Format function?
I've been using the built-in Format() function successfully in Excel VBA for years. However, I have just come across a situation that would appear to be a bug. When the input value is Empty (Variant), ...