excel-vba

Open Particular Excel Worksheet from Powerpoint via VBA

谁都会走 提交于 2020-01-25 16:41:31
问题 I have a Power Point presentation that contains data pasted into it from Excel using VBA. The data in the excel file is a table that contains hyperlinks to other worksheets within the same workbook. The VBA that creates this as an example is : 'Adds hyperlink to each worksheet user can use to find from powerpoint Range("B2").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ "'Title Missing'!A1", TextToDisplay:="Missing Title Tags" This code works just fine - The

Open Particular Excel Worksheet from Powerpoint via VBA

删除回忆录丶 提交于 2020-01-25 16:41:10
问题 I have a Power Point presentation that contains data pasted into it from Excel using VBA. The data in the excel file is a table that contains hyperlinks to other worksheets within the same workbook. The VBA that creates this as an example is : 'Adds hyperlink to each worksheet user can use to find from powerpoint Range("B2").Select ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _ "'Title Missing'!A1", TextToDisplay:="Missing Title Tags" This code works just fine - The

Count cells by their color in Excel

末鹿安然 提交于 2020-01-25 13:12:11
问题 This question is simple: How can I update a total number count in Excel that decreases based on how many red X's there are in a given column. Where this becomes too complicated for me: I have made macros to sort cells based on numbers or color. There are five different colors, each representing a different county in my area. I have a total for each county. (ex. yellow = 41, blue = 15, red...) and want to update each colors total respectively (by subtracting 1 for each X) IF there is an X in

Excel VBA Find.Method , searching for 2 Values in a row writing a value

江枫思渺然 提交于 2020-01-25 12:47:48
问题 I want to search within a table e.g. A B C D E C A H I A H C For the Values "A" and "C" and then put the Value "Value" into a cell in the rows where both Values have been found. I am fairly new to the whole topic so i searched first on the web to find pieces of code that could help me. Dim FirstAddress As String Dim SecondAddress As String Dim MyArr As Variant Dim MyArr2 As Variant Dim Rng As Range Dim Row As Range Dim I As Long Dim B As Long With Application .ScreenUpdating = False

Application.WorksheetFunction.Sum is not working on filtered results VBA

早过忘川 提交于 2020-01-25 11:35:46
问题 I'm trying to use WorksheetFunction.Sum to sum the same field on all rows in the result, however, it doesn't seem to be doing it. It doesn't throw an error, it just doesn't sums anything. I know for a fact some rows should throw more than 1 row result. This is what I'm trying to do: For Each Code In BomCodes With InventorySheet .AutoFilterMode = False .Range("B1").AutoFilter Field:=2, Criteria1:="Project" .Range("D1").AutoFilter Field:=4, Criteria1:="ContractNumber" .Range("N1").AutoFilter

Custom printing area macro

亡梦爱人 提交于 2020-01-25 10:32:26
问题 I'm making a macro that sets a print area to user selected areas of document. Basically there is a box next to a bunch of cells and if user ticks the box then the bunch of cells is included to the print area. Here is my code so far: Sub TestCellA1() Dim t As Integer, d As Integer t = 0 d = 20 Dim rng_per As Range Set rng_per = Range("A3:E328") 'prints whole document Dim rng1 As Range If Not IsEmpty(Range("F19")) = True Then ActiveSheet.PageSetup.PrintArea = Range(rng_per) Else Do While t < 10

How can i make a sub for a keypress event?

≯℡__Kan透↙ 提交于 2020-01-25 10:19:07
问题 I'm working on an excel with macros. I have a userform with textboxes, several of them use a function for only press numbers. Private Sub quantity1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger) Select Case KeyAscii Case Asc("0") To Asc("9") Case Else KeyAscii = 0 End Select End Sub How can i put the select case on a procedure or function and then call it from any keypress event that i need it (in this case, quantity1 quantity2, price1 and price2, but no in buyer)? I tried making a sub

How to hide workbook behind userform?

前提是你 提交于 2020-01-25 10:05:02
问题 I've tried multiple methods to hide specific workbook behind userform! Last code I've used is here: Private Sub UserForm_Layout() Application.Left = MainWindow.Left Application.Top = MainWindow.Top End Sub Private Sub UserForm_Activate() Application.Left = Me.Left Application.Top = Me.Top Application.Width = Me.Width * 0.85 Application.Height = Me.Height * 0.85 End sub It will hide application window behind userform, but if there is multiple workbooks open and I activate one of them, when I

How to hide workbook behind userform?

扶醉桌前 提交于 2020-01-25 10:04:24
问题 I've tried multiple methods to hide specific workbook behind userform! Last code I've used is here: Private Sub UserForm_Layout() Application.Left = MainWindow.Left Application.Top = MainWindow.Top End Sub Private Sub UserForm_Activate() Application.Left = Me.Left Application.Top = Me.Top Application.Width = Me.Width * 0.85 Application.Height = Me.Height * 0.85 End sub It will hide application window behind userform, but if there is multiple workbooks open and I activate one of them, when I

Copying data from a MS Access form into Excel

泪湿孤枕 提交于 2020-01-25 09:19:06
问题 I have code that takes fields from a MS Access form and copies the data into a saved Excel file. The first record in Access in imported to Excel with a range of A2:I2. The second record in Access is imported to Excel with a range of A3:I3, and so on.... What currently happens now is if I close my form in Access and open it back up, and say I already had two records imported into this same Excel file, and now I want to add a third record, it will start over at the first row (A2:I2) and write