216,504 questions
0
votes
1
answer
44
views
sorting code getting 1004 error in excel vba [closed]
here is my code... i have data in sheet2 with 5 columns. I would like to sorting with E column. Following code working properly, but some times it is throwing 1004 error (Method range of object ...
2
votes
2
answers
78
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), ...
Advice
0
votes
20
replies
270
views
Date function vba how to
I have this code that works great except for when the end of the week comes up I have to change 8 to 15 or vise versa in order to get to the correct workbook. Is there another way? This code is to ...
0
votes
0
answers
143
views
As part of a function, how could I create a variable number of sums one inside another based on a parameter?
I'm currently struggling on an assignment (probability class) which require creating a function (VBA excel) that contains a variable number of sums one inside the other based on a parameter. I'm not ...
1
vote
2
answers
107
views
Searching for a range of dates in Excel Using VBA
I have a problem in making a search for a range of dates with VBA. Using the start date as the default search in the date range and when find the same date start to count (x) in the range between the ...
-1
votes
1
answer
90
views
VBA Code for Recordset to pull information from Table to Form
I am working on pulling information from a table into a Check In & Out form. We will be cataloging helmets using barcodes. With the way I have the form set up, scanning a barcode will ...
0
votes
1
answer
102
views
insert row with total where criteria count ends
i have excel sheet with 5 columns. i used following code for sorting. it works fine
lrow As Long
lrow = Application.WorksheetFunction.CountA(Sheet2.Range("A:A"))
Sheet2.Range("A3:E&...
1
vote
0
answers
72
views
How to run VBA scripts only in the Word document I'm currently editing? [closed]
I have this code:
Private WithEvents App As Word.Application
Private Sub Document_Open()
Set App = Word.Application
End Sub
Private Sub Document_New()
Set App = Word.Application
End Sub
...
Advice
0
votes
3
replies
77
views
Prevent Duplicate Sheets when Adding using VBA
I am adding new sheets to a workbook using the value of a column.
In the column there are duplicate values. I want to skip a duplicate value in my loop.
0
votes
1
answer
96
views
How to insert nested fields in VBA for Word? [closed]
I would like to make a VBA macro for Word 2021 that will insert an IF field with STYLEREF fields inside it, to show the beginning and ending paragraph numbers in a page header.
I am able to insert the ...
Best practices
0
votes
2
replies
118
views
What is standard practice for handling VBA fixed-length string data in binary files?
I'm quite frustrated trying to write to a binary file in Excel VBA. The issue is with fixed-length string data in a Type structure. (Note that my binary file requirements are that fixed-length string ...
0
votes
1
answer
114
views
VBA Code to get a formula returned in column2 when column1 is not empty, error in my formula
I have the following VBA code, but one line is giving an error:
rng(i, 4).Formula = "=IF(LEFT(A" & (i + 1) & ",2)="RN","RN",IF(LEFT(A" & (i + 1) &...
-4
votes
1
answer
106
views
MS Access: I have a problem with an object declaration
Someone can tell me what is wrong with my code?
When I click on the btn_prelrep button, I want to get information from equipment input control, that information is concatenated with the path of a file ...
0
votes
1
answer
173
views
Why am I getting an Out of Memory error with this specific VBA code?
I have Power Query table in an Excel spreadsheet that filters a different table for a specific Index number using a List Box of Client Names.
The first table has 3 columns:
Index
Attribute
Value
1
...
2
votes
3
answers
196
views
Insert and Paste Values to a protected sheet
This Excel VBA code is supposed to copy the entries from Sheet "Entry" then Insert & Paste only Values in Sheet "List".
Sheet List has a password to prevent editing.
Sub ...