[RESOLVED] VBA automatically adds a leading zero to a number stored as text
VBForums » Office Development
by Chrissy
2d ago
I have an Excel spreadsheet where the user enters a code and then clicks a button. The macro takes the code and looks it up in the database to return data. The issue I am having is that the code being entered is .16225 and VBA is adding a leading zero so the query is returning "Not Found". I don't understand why it is adding the leading zero. The cell is formatted as Text and when using in my query I am using Format(). Below is the snippet of code along with a visual of how it is being interpreted. Code:         Call rsInit(rsData)     rsData.Source = ("SELECT ..read more
Visit website
Inquiry Regarding Outlook Rules
VBForums » Office Development
by PeterC12
4d ago
Good day, I have an issue regarding Outlook rules that I'm struggling with, and I'm curious if you have any tips! I have a scenario concerning rules in Outlook. I want outgoing emails that I send with a question to receive a blue label. I've managed to set this up using rules, which works perfectly. Subsequently, I'd like for the blue label to disappear when I receive a reply to these emails, and for the new email to appear green in my inbox. (The green coloring upon reply in the inbox works fine, but the blue category label remains in my sent items.) The goal is to have a clear overview ..read more
Visit website
Atomatically Moving Data Between Sheets
VBForums » Office Development
by APapa
3w ago
I need help with an excel VBA code for a sch. proj. pls. The code moves contents from a "2C" sheet when cell contains the text "Less Than 30" to a final sheet name "<30day." The current code moves the entire column from "2C" to column A in "Less Than 30", I want it to move it to column B in "Less Than 30" because I want to put something in column A. The current code clears what I put in column A of "Less Than 30" when run. Im not a coder and this code is from a YouTuber (Excel 10) Below is the attached code. Private Sub Worksheet_Change(ByVal Target As Range) Dim Z As Long Dim xVal As ..read more
Visit website
MsOf365 [Word] Access custom document properties in the parent from an inserted document
VBForums » Office Development
by bberry77
3w ago
How can I access custom document properties of a parent document from a macro in a document that has been inserted into that parent document ..read more
Visit website
Set timer for a excel spread sheet using a variable for the time value
VBForums » Office Development
by bbxrider
1M ago
trying to start a sheet update routine with the timer using a variable. see code below, when I use the hard code that works but not working when using a variable, it doesn't start the timer, perhaps a different way to start the timer? Public Sub startTimer() '... the following is the procedure to run on the timer' saveRTDinfo 'Sub saveRTDinfo() alertTime = alertTime 'for debugging to view value alertTime = now + TimeValue(alertTime) 'doesn't work see next line 'debug.print "alertTime = " & alertTime, this prints 00:02:00, literally, without parens alertTime = now + TimeValue("00:02:00 ..read more
Visit website
Excel VBA Clipboard error
VBForums » Office Development
by jdc2000
1M ago
I have an Excel workbook with macros that copy data from various sheets to cells on a main sheet. These macros have worked flawlessly for years, however, today I find that I am getting the following error message: We couldn't copy the content to the clipboard because it's in use by another application. You can still paste your content within this workbook, but it won't be available in other applications. The code that is used to copy the data is below: Code: Application.ScreenUpdating = False Sheet2.Range("I1:O1").Copy Sheet1.Range("L1:R1").PasteSpecial Paste:=xlPasteAll Sheet1.Range("L1 ..read more
Visit website
[RESOLVED] Determine which computer is running Excel file
VBForums » Office Development
by Bezzie
1M ago
I have model in Excel that are run from two different computers (a desktop and a laptop). The model uses a file to import data that is located in a OneDrive folder. The path to that OneDrive folder differs on the two computers. I then have a Const that is set to the OneDrive folder so the model know where to find the file for the import. Is there a way in VBA I can detect, at startup, which computer is running the model and then set the Const programmatically to the correct folder? Something like: Code: If 'Computer is Desktop' then     Const FS_Intermediate_File as String = 'path ..read more
Visit website
Remove special characters from all file names within a folder
VBForums » Office Development
by JoinintTheDots
1M ago
Hello brains trust, I hope you can help me, please. I have a number of documents to upload into a system that does not permit upload where file names contain special characters, being: / : * ? " <> | # { } % ~ &"." Is there a VB script I can use to cycle through all the files in a folder and remove all of the above characters from the file names, but otherwise leave them the same? The characters do not necessarily appear in the same position in each file name, so functions using specific character positions won't work. Thanks in advance for your assistance! Cheers Dots ..read more
Visit website
Determine which computer is running Excel file
VBForums » Office Development
by Bezzie
1M ago
I have model in Excel that are run from two different computers (a desktop and a laptop). The model uses a file to import data that is located in a OneDrive folder. The path to that OneDrive folder differs on the two computers. I then have a Const that is set to the OneDrive folder so the model know where to find the file for the import. Is there a way in VBA I can detect, at startup, which computer is running the model and then set the Const programmatically to the correct folder? Something like: Code: If 'Computer is Desktop' then     Const FS_Intermediate_File as String = 'path ..read more
Visit website
Chart Object does not load data
VBForums » Office Development
by Sunoseno
2M ago
I calculate some data and using them later in this code snippet to create a chart. It worked completly fine until i changed the line weight from 3 to the calculation it is now. Reversing the change didn't help. The problem is that the chart does not have the data shown and gives an error when pointing on any data in the seriescollections like when creating the box at the bottom of the code. This can manuelly resolved by right clicking into the chart and "Select Data" and selecting another data series, but this process can't be done by VBA. Refresh and DoEvents do not help. Since this problem a ..read more
Visit website

Follow VBForums » Office Development on FeedSpot

Continue with Google
Continue with Apple
OR