vba

VBA - Sub or Function not Defined

眉间皱痕 提交于 2021-02-05 08:51:58
问题 I keep getting a Sub or Function not Defined compile error with my code. What I am trying to accomplish is to take two item descriptors via input in a cell and then generate a unique alphanumeric serial number to that item and then output it onto the screen as well as save it on another sheet(which admittedly haven't even started to work on). However, I keep running into the issue of this compile error when trying to get my SerialGenerator function to work. I am trying to call the function to

VBA - Sub or Function not Defined

五迷三道 提交于 2021-02-05 08:51:02
问题 I keep getting a Sub or Function not Defined compile error with my code. What I am trying to accomplish is to take two item descriptors via input in a cell and then generate a unique alphanumeric serial number to that item and then output it onto the screen as well as save it on another sheet(which admittedly haven't even started to work on). However, I keep running into the issue of this compile error when trying to get my SerialGenerator function to work. I am trying to call the function to

Excel VBA selecting a cell getting error 1004 Select Range class failed

你说的曾经没有我的故事 提交于 2021-02-05 08:48:26
问题 The code below is a template used for a bunch of automations. all works fine until the line where i'm trying to select a certain cell. I'm doing that so that if somewhere in the code I add some code that manipulates a cell somewhere far in the document, I want it to select the first cell with data (in my case it's a variable ExcelPasteTo), so that when the user open the file,it doesn't shift to cell AZX298, for example. So far, i'm getting stuck at this line .Range(ExcelPasteTo).Select what's

Subscript out of range — Unable to set open workbook as active workbook

旧时模样 提交于 2021-02-05 08:34:09
问题 I'm trying to copy two cells B2 & C2 from the Results worksheet on every single workbook within a folder and then paste cells in a Master workbook starting in cell A1, A2, A3 etc I'm getting the error Subscript out of range it isn't highlighting anything specific but I'm assuming it's because the workbook the macro is running from doesn't have a 'Results' sheet. It's opening the correct workbook Workbooks.Open (Filepath & MyFile) but I don't seem to be able to set the newly opened workbook as

VBA: How to wait for page to load

一个人想着一个人 提交于 2021-02-05 08:24:28
问题 I'm in the middle of writing a script for signing into a form, and filling in a bunch of "sign up" information and clicking submit. Thus far, i have managed to get the script to navigate to the sign in page, enter username, enter password and click "sign in". However, whilst I would normally use the "While IE.readyState <> 4 Or IE.Busy: DoEvents: Wend" function to wait for the next page to load, i am having trouble because unfortunately what appears to be happening is that once the sign in

Access: ConcatRelated works on a table, but not on a query

安稳与你 提交于 2021-02-05 08:19:06
问题 I have been using Allen Browne's ConcatRelated function, and while it works fine when the data comes from a table, but it doesn't work when the data comes from a query. The green 'running query' bar appears for a few seconds, but then when it tries to display the data it shows only one field from the first row, runs very slowly and can take a few minutes to display the first screen of records. I've not managed to leave it long enough to complete the result set, have to shut down Access using

Time calculation from Date & Time

夙愿已清 提交于 2021-02-05 08:14:28
问题 I am trying to figure out a way where I can use MS access to convert the the following data to show the minutes spent within each column, whilst also discounting weekends from the final figure. This data is pulled from a project management software where the task is passed through each column as it goes through the relevant stage of calibration (hence the data format as shown). This table will also store the transition data for all products that go through this process. Will this calculation

How to mimic regular Expression negative lookbehind?

杀马特。学长 韩版系。学妹 提交于 2021-02-05 08:11:40
问题 What I'm trying to accomplish I'm trying to create a function to use string interpolation within VBA. The issue I'm having is that I'm not sure how to replace "\n" with a vbNewLine , as long as it does not have the escape character "\" before it? What I have found and tried VBScript does not have a negative look behind as far as I can research. Below has two examples of Patterns that I have already tried: Private Sub testingInjectFunction() Dim dict As New Scripting.Dictionary dict("test") =

How to mimic regular Expression negative lookbehind?

不打扰是莪最后的温柔 提交于 2021-02-05 08:11:24
问题 What I'm trying to accomplish I'm trying to create a function to use string interpolation within VBA. The issue I'm having is that I'm not sure how to replace "\n" with a vbNewLine , as long as it does not have the escape character "\" before it? What I have found and tried VBScript does not have a negative look behind as far as I can research. Below has two examples of Patterns that I have already tried: Private Sub testingInjectFunction() Dim dict As New Scripting.Dictionary dict("test") =

Getfolder order by file name

本小妞迷上赌 提交于 2021-02-05 08:11:12
问题 This is my VB code for merging XML but I would like to merge it by file name. So first 1.xsl then 2.xsl How to order a list in VB? Sub simpleXlsMerger() Dim bookList As Workbook Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object Application.ScreenUpdating = False Set mergeObj = CreateObject("Scripting.FileSystemObject") 'change folder path of excel files here Set dirObj = mergeObj.Getfolder("D:\change\to\excel\files\path\here") Set filesObj = dirObj.Files For