vba

Deactivate msgbox in a sub VBA

爷,独闯天下 提交于 2021-02-19 07:47:27
问题 Sub prelim() MsgboX "Hello World" End Sub Sub Main() Call prelim End Sub In the above code Sub prelim can't be edited.I want msgbox when I run Sub prelim but when I run Sub Main I don't want the message box to get popped out. How to do it? 回答1: This is not possible without changing Sub prelim Sub prelim(Optional silent As Boolean = True) If Not silent Then MsgBox "Hello World" End Sub Sub Main() prelim True 'no msgbox prelim False 'with msgbox prelim 'no msgbx End Sub 来源: https:/

How do I match header in different sheets and copy/paste the second row if there's a match?

混江龙づ霸主 提交于 2021-02-19 07:34:20
问题 I have an Excel document with two different Sheets. Sheet 1 has many columns with header names and blank rows. Sheet 2 has some of these columns with exact header names and an entry in the 2nd Row. I want to make a macro that will look through all the column headers in Sheet 2 and find their corresponding match in Sheet1. When the match is found, I need to copy the entry in Row 2 of the Sheet2 header into the matching header of sheet1. Some entries in Sheet1 will not have matches and will

How do I match header in different sheets and copy/paste the second row if there's a match?

天大地大妈咪最大 提交于 2021-02-19 07:34:10
问题 I have an Excel document with two different Sheets. Sheet 1 has many columns with header names and blank rows. Sheet 2 has some of these columns with exact header names and an entry in the 2nd Row. I want to make a macro that will look through all the column headers in Sheet 2 and find their corresponding match in Sheet1. When the match is found, I need to copy the entry in Row 2 of the Sheet2 header into the matching header of sheet1. Some entries in Sheet1 will not have matches and will

How do I remove links from a workbook linked to another

风流意气都作罢 提交于 2021-02-19 07:12:37
问题 I have a sheet(Questions) in a workbook(Rating) that has a button at the bottom of the Questions sheet that copies sheet 2(quote) from the Rating workbook and pastes it in a new workbook that is named according to the quote number and then saved. Here is that code: Sub GetQuote() Range("AK548").Select Selection.Copy Range("AK549").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Dim Output As Workbook Dim FileName As String Set

How do I remove links from a workbook linked to another

风格不统一 提交于 2021-02-19 07:12:35
问题 I have a sheet(Questions) in a workbook(Rating) that has a button at the bottom of the Questions sheet that copies sheet 2(quote) from the Rating workbook and pastes it in a new workbook that is named according to the quote number and then saved. Here is that code: Sub GetQuote() Range("AK548").Select Selection.Copy Range("AK549").Select Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False Dim Output As Workbook Dim FileName As String Set

How to copy powerpoint sections to a new presentation using VBA

旧时模样 提交于 2021-02-19 06:55:25
问题 We typically use powerpoint to facilitate our experiments. We use "sections" in powerpoint to keep groups of slides together for each experimental task. Moving the sections to counterbalance the task order of the experiment has been a lot of work! I thought we might be able to predefine a counterbalance order (using a string of numbers representing the order) in a CSV or array (haven't built that out yet in VBA). Then using VBA to move the sections and save the file for each order. I am

How to copy powerpoint sections to a new presentation using VBA

回眸只為那壹抹淺笑 提交于 2021-02-19 06:55:19
问题 We typically use powerpoint to facilitate our experiments. We use "sections" in powerpoint to keep groups of slides together for each experimental task. Moving the sections to counterbalance the task order of the experiment has been a lot of work! I thought we might be able to predefine a counterbalance order (using a string of numbers representing the order) in a CSV or array (haven't built that out yet in VBA). Then using VBA to move the sections and save the file for each order. I am

Copy HTML table at once, without looping through cells

五迷三道 提交于 2021-02-19 05:43:05
问题 I want to copy the content of a HTML table . Is it possible to do this without looping through cells in the table? (example of what I'm trying to avoid : Under the comment 'Loop Through Each Table and Download it to Excel in Proper Format. My table isn't very big, so looping is an option, just wandering if there is a better option. What I have now and suggested method I would prefer: 'check all opened windows and find the one with PV output For Each shlWindow In Shell.Windows If TypeName

Insert word document to another word document without changing the format VBA

那年仲夏 提交于 2021-02-19 05:26:43
问题 First I copy a word document doc1 to a new word document with it format via a button on a userform. Second I insert at the end of this word document (filled with doc1) a new word document doc2 (doc1 and doc2 got text and table and various colors). Each time I pressed a button on another userform to put doc2, I lose the format of doc2. Here my code: Dim docSource As Document Dim docTarget As Document Set docTarget = ActiveDocument Set docSource = Documents.Open(strFilename) ' Add the content

How do I convert a stdole.StdPicture to a different Type?

有些话、适合烂在心里 提交于 2021-02-19 05:02:48
问题 To receive the bounty, please provide an answer with working code. Thanks. I have a stdole.StdPicture Object of the Type vbPicTypeIcon. I need to convert it to Type vbPicTypeBitmap. Due to project contraints, I need to be able to do this using Win32 or VBA. I am trying to load a file's icon to a command bar button. Here is what I have so far. It produces a lovely black square:) I am really new to graphics land so pardon me if it's a basic question. Option Explicit Private Const