excel-vba

VBA module that runs other modules

六眼飞鱼酱① 提交于 2020-01-13 08:26:31
问题 I'm programming in Microsoft VBA. At first I need to generate a QueryTable with the help of a macro (I've got the code for that) and after that with the help of macros I need to apply formulas that use the data in the QueryTable. The problem that I am facing is that the QueryTable appears only after the Sub, in which its code is, has finished working. That means that I cannot include the code that generates formulas in it, because there is no data for the formulas to be generated on. The idea

Is there any way I can speed up this VBA algorithm?

僤鯓⒐⒋嵵緔 提交于 2020-01-13 08:07:46
问题 I am looking to implement a VBA trie-building algorithm that is able to process a substantial English lexicon (~50,000 words) in a relatively short amount of time (less than 15-20 seconds). Since I am a C++ programmer by practice (and this is my first time doing any substantial VBA work), I built a quick proof-of-concept program that was able to complete the task on my computer in about half a second. When it came time to test the VBA port however, it took almost two minutes to do the same --

Is there any way I can speed up this VBA algorithm?

吃可爱长大的小学妹 提交于 2020-01-13 08:06:52
问题 I am looking to implement a VBA trie-building algorithm that is able to process a substantial English lexicon (~50,000 words) in a relatively short amount of time (less than 15-20 seconds). Since I am a C++ programmer by practice (and this is my first time doing any substantial VBA work), I built a quick proof-of-concept program that was able to complete the task on my computer in about half a second. When it came time to test the VBA port however, it took almost two minutes to do the same --

Excel vba, compare rows of two workbooks and replace

点点圈 提交于 2020-01-13 07:19:48
问题 Here is a bit of background on what I'm trying to achieve. I have an excel file, which contains 10 sheets and each of the sheets contain many rows of data. This workbook is sent to different people and each one fills in their respective info,only in columns A,B. I have made a vba script which loops through all the filled in workbooks, and checks which rows have cells Ax , Bx filled. Then it copies those in a new workbook. So what I have right now is: A workbook which contains only the rows of

VBA Outlook Appointment

馋奶兔 提交于 2020-01-13 07:11:27
问题 I am trying to copy data from Excel to Outlook appointment Item. I have already created a template with a table and some images and would like the data to be copied from the excel file in the already formatted table in the body of the template. However, unlike e-mail, outlook appointment does not support ".htmlbody" property hence, its getting difficult to paste the data in the template. So far, I am trying to do this: Dim olAppItem as Outlook.AppointmentItem Set olAppItem = olApp

Connecting to FTP from Excel to automate file sharing (VBA Beginner)

荒凉一梦 提交于 2020-01-13 06:45:11
问题 I'm a beginner and new to Excel VBA, but I'm trying to automate some file sharing in FTP (WinSCP) by connecting to Excel and maybe creating a macro that will help. In FTP I went to Session > Generate Session URL/code > Script (script file) and the following code is there: open ftp://myUsername:myPassword@theHostname/ # Your command 1 # Your command 2 exit I'm assuming the open line would connect Excel to FTP. I'm referencing code from this site to put into the '# command' area: https://www

How to refresh calculation instantaneously in excel

喜夏-厌秋 提交于 2020-01-13 06:36:29
问题 I have a problem in refreshing the cell's calculation. In other words, I have many columns where i have a formula or macro in each one of them. But the problem is that i should absolutely activate the option " automatic calculation" in the excel options or i should save then the new results appear. Now, I would insert something in the macro that can refresh me the results instantaneously. Thanks 回答1: You could simply press : F9 to calculate the whole active workbook Shift + F9 to calculate

Excel VBA to Search for Text in PDF and Extract and Name Pages

允我心安 提交于 2020-01-13 06:30:09
问题 I have the following code, which looks at each cell in column A of my spreadsheet, searches for the text it finds there in the specified PDF and then extracts the page where it finds the text as a PDF, naming it with the value in the cell of the spreadsheet. The code works but is rather slow, I may need to search for as many as 200 words in a PDF which could be as long as 600 pages. Is there a way to make the code faster? Currently it loops through each cell searches through each page looping

Switch off R1C1 reference style for recorded VBA macros

时间秒杀一切 提交于 2020-01-13 06:13:49
问题 In recorded VBA macros, it seems that their formulas use R1C1 reference style . For instance, to fill in B4 with B2+1 : Range("B4").Select ActiveCell.FormulaR1C1 = "=R[-2]C+1" Does anyone know if it is possible to switch off this mode? For instance, let recorded macro look like: Range("B4").Select ActiveCell.Formula = "=B2+1" 回答1: I believe you cannot do that. The macro will always record in R1C1 style. You can always switch the style but it will only be applied to the worksheet and if you

Switch off R1C1 reference style for recorded VBA macros

断了今生、忘了曾经 提交于 2020-01-13 06:12:49
问题 In recorded VBA macros, it seems that their formulas use R1C1 reference style . For instance, to fill in B4 with B2+1 : Range("B4").Select ActiveCell.FormulaR1C1 = "=R[-2]C+1" Does anyone know if it is possible to switch off this mode? For instance, let recorded macro look like: Range("B4").Select ActiveCell.Formula = "=B2+1" 回答1: I believe you cannot do that. The macro will always record in R1C1 style. You can always switch the style but it will only be applied to the worksheet and if you