Category "vba"

How do I save changes made to data within a Userform back to the same row where the data came from?

I have found code to search a table and load cell values into the form. I need to be able to make changes and save the form data back to the table to update th

Return filename with wildcard

sFile = Dir(sPath & sFile) Debug.Print sFile 2022.txt is returned if sFile (the active cell) contains 2022.txt; how can I return the same if sFile contains

Data Mismatch error while using the Update query

I am using the Update query inside VBA to Update one particular column. But I am getting the Data Mismatch in criteria expression error. Please find below the c

How to find a syntax error in my SQL code?

I am trying to compile my code but every time I get the same error: Syntax error (missing operator ) in query expression ' True Status.Subsystem Not LIKE '''

Excel VBA - Set timer goes faster after each loop

I am trying to create a timer that when reaching zero, it calls from the "Database" script, and then repeats the timer again from 30 seconds. Problem is, every

VBA to duplicate large dataset using array

I have data on sheet A and want to duplicate it on sheet B. Because it is a lot of data, I do not want to use copy-paste. If I really simplify it, this is my co

VBA Runtime error 6: overflow on one calculation, but other calculations work

I'm trying to run the following code, but I'm getting a runtime error 6: overflow for the last calculation that I am trying to do. The program stops when it rea

VBA UserForm Frame ScrollTop function not working from class function

This should be a simple task and I've been coding in VBA for 10+ years but I cannot seem to get this to work. I have a UserForm with a MultiPage (with 2 pages)

using DDE get a response from Python to VBA in MS Access

I have a need to pass strings back forth from a python script to a VBA application running in MS Access. Communication from VBA to Python works great! Communica

Want to display notification in Task pane in Word using VBA

I have coded a VBA macro that notifies me whenever a new comment has been added to a document using a MsgBox. I now require that no notification should be in th

Range with Cells Function (Runtime Error - 1004 --> Application-defined or object Defined error)

Could you please help on the below code. I have 2 workbooks and i want to copy the columns from one to another with the matching header. It shows an error in th

Trying to calculate a 1hr range within the last 12hrs of a range with VBA

So I am trying to calculate a test temp for 1hr from the last 12 hours of data. Sometimes this data can be several days some times it can be only 24hrs. The sta

Overwrite Object Property with Another Object

I am working in VBA, and I need to set the .Interior property of a Range object, to the value of its own .DisplayFormat.Interior. More generally, I want to pas

Excel case-sensitive COUNTIF with wildcards: native function?

I'm trying to find a native Excel function (or combination thereof) which will behave precisely in the manner of COUNTIF (i.e will handle wildcards), but is cas

VBA PPT: How to add an image and send it behind the text or add it as a background image?

So we are trying to create some ppt report based on excell data. I'd like for the first slide to have a background image or just an image that is set behind the

How can i copy a Value of a certain Column if another column has "No" in it?

Very specific question. I got a task to learn vba, but i cant really find anything for my problem. screenshot of how it looks in project Basically if the column

Excel VBA Auto-Save IF, THEN, ElSE

I'm trying to make an Excel VBA macro to automate my saves. So if it is 2022 or 2023 and it is either the month of January, February, march, etc. The file will

Differentiate between "1" and "11"

I have 20 cases. For every row in my sheet, I have a cell that assigns related case numbers to it. A row could have multiple case numbers assigned to it in that

How can you access hidden published ms-project .mpp files

I was writing a simple script in VBA for batch updating project info posted on Project Web App. I've stumbled on a problem which seems unsolvable to me though,

variable pivot data range (i.e no. of rows and columns gets change)

iam gettin an error while running below code, i want to apply pivot table to dynamic data range ( data gets change everytime i.e rows and columns) i want macro