vba

Delete automatic Signature from forwarded emails VBA macro

人走茶凉 提交于 2021-02-10 14:25:43
问题 Newbie Outlook VBA. intermediate Excel VBA. Windows 7 Professional, Outlook 2010 I have a script running from a rule that autoforwards all incoming emails. I need it as a rule because otherwise it will not forward the mails in the queue when Outlook loads. I would like to have the default signature deleted when the mails are forwarded. As the reply is "blank" it is unnecessary to have the sig appended. I have found some code that supposedly worked in Outlook 2007 from the MSDN site. It

Word VBA: find line and replace font

半城伤御伤魂 提交于 2021-02-10 14:24:34
问题 I've written a VBA Word Macro that read a .txt File, copy it and paste it in a Word document setting a new font. All is working fine! Now I would like to highlight some specific lines with bold + italic font, but i cannot figure out a working solution. The specific lines begins with a specific word (for example Simulation Nr.xxx ) or they begin with some words but then they have a very long series of blank spaces (for example Turbine ). How can i solve the problem? P.s.: here the working code

Word VBA: find line and replace font

时光毁灭记忆、已成空白 提交于 2021-02-10 14:23:09
问题 I've written a VBA Word Macro that read a .txt File, copy it and paste it in a Word document setting a new font. All is working fine! Now I would like to highlight some specific lines with bold + italic font, but i cannot figure out a working solution. The specific lines begins with a specific word (for example Simulation Nr.xxx ) or they begin with some words but then they have a very long series of blank spaces (for example Turbine ). How can i solve the problem? P.s.: here the working code

#value! error in UDF when doing simple division

时光毁灭记忆、已成空白 提交于 2021-02-10 14:17:17
问题 When doing a simple division problem with some defined variables I am getting the #value error in a UDF. The variables are all defined as doubles. Apologies in advance as I am a mechanical engineer by trade so my coding is very amateur. I have a design book I use in excel that can end up being many columns long so to avoid this I am trying to code some UDFs to eliminate the all the cells just doing calculations for other cells. With that, I have run into an issue that I have in my

Excel/VBA - Fill color of a cell in pivot table according to column value

半城伤御伤魂 提交于 2021-02-10 14:12:07
问题 I have a pivot table that the source is a table on another sheet. The source table looks like this: Client Type of income Value Month Control A Residential 1000 January Paid A Commercial 2000 February Not paid B Residential 2000 February Not paid C Commercial 1500 February Paid D Consulting 5000 March Paid The pivot table is set like this: Column - Month Row - Client Value - Sum of value Client January February March A 1000 2000 0 B 0 2000 0 C 0 1500 0 D 0 0 5000 Now I want to fill the color

Class Object TextBox on Userform available methods

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 13:37:14
问题 I have noticed that when I create a Class Module for a Textbox and use that on my forms - by adding via VBA in the form init event - neither the Enter or Exit methods are available. Of course if I just add a textbox to the form they are. I can get the DblClick method to work fine so my class is setup correctly and my form.init code is also ok. When I look in the Object browser for MSForms.TextBox I see it doesn't have Enter or Exit methods and presume this is the reason. There is no urgency

Excel VBA Assignment by value or by reference?

只愿长相守 提交于 2021-02-10 13:29:14
问题 I have two objects of the same class which have a property that's an array of doubles (Double()), and I would like to do the following: Obj1.arr_property = Obj2.arr_property Is the above going to assign by value or by reference? If by reference, how to make it by value instead? 回答1: Everything that you assign with Set only copies the reference to the new variable, not the data. You do not use Set , so all values of the array are copied, not just the reference to the array. You actually cannot

run macro when open workbook

拜拜、爱过 提交于 2021-02-10 13:16:58
问题 I have done a search. The most relevant suggests the macro name of "workbook_open" But I still must manually invoke the module. Here's what I've coded. (Any other suggestions welcome as this is my first vba script -- at age 73) Sub Workbook_Open() Dim lastRow As Long 'last row with data Dim thisDate As Double 'start timestamp thisDate = Now() With Sheets("Pressure Log") lastRow = .Range("B" & .Rows.Count).End(xlUp).Row 'populate next row with date/time Range("B" & lastRow).Offset(1) = Format

run macro when open workbook

感情迁移 提交于 2021-02-10 13:16:52
问题 I have done a search. The most relevant suggests the macro name of "workbook_open" But I still must manually invoke the module. Here's what I've coded. (Any other suggestions welcome as this is my first vba script -- at age 73) Sub Workbook_Open() Dim lastRow As Long 'last row with data Dim thisDate As Double 'start timestamp thisDate = Now() With Sheets("Pressure Log") lastRow = .Range("B" & .Rows.Count).End(xlUp).Row 'populate next row with date/time Range("B" & lastRow).Offset(1) = Format

run macro when open workbook

梦想的初衷 提交于 2021-02-10 13:16:32
问题 I have done a search. The most relevant suggests the macro name of "workbook_open" But I still must manually invoke the module. Here's what I've coded. (Any other suggestions welcome as this is my first vba script -- at age 73) Sub Workbook_Open() Dim lastRow As Long 'last row with data Dim thisDate As Double 'start timestamp thisDate = Now() With Sheets("Pressure Log") lastRow = .Range("B" & .Rows.Count).End(xlUp).Row 'populate next row with date/time Range("B" & lastRow).Offset(1) = Format