excel

Including a non-adjacent cell in a Range (series) in the XIRR formula

时光怂恿深爱的人放手 提交于 2021-02-07 06:24:07
问题 I am using the XIRR formula as follows: =XIRR(E$11:E17,B$11:B17) but need to add an additional non-adjacent cell to the Range of values and dates. My first attempt: =XIRR((E$11:E17,H17),(B$11:B17,B17)) resulted in #VALUE I have attempted to do it using the CHOOSE function as follows: =XIRR(CHOOSE({1,2},E$11:E17,H17),CHOOSE({1,2},B$11:B17,B17)) But this is not working to produce the correct results. I cannot figure out how to add one cell onto the end of the range. The following did work to

excel vba getting the row,cell value from selection.address

天大地大妈咪最大 提交于 2021-02-07 05:13:13
问题 For i = 1 To 20 '' select the cell in question Cells.Find(...).Select '' get the cell address CellAddr = Selection.Address(False, False, xlR1C1) Next The above is my code for searching a spread sheet to find a specific string and then select it. I'd like to get the address of the cell using Selection.Address which, in this case, returns something along the lines of R[100]C . Is there a way I can split that result in to row and column values so I can manipulate them in code? I'd like, for

Create List of unique elements and display group membership parsed by commas and en-dash

落花浮王杯 提交于 2021-02-07 04:36:11
问题 I'm an Excel VBA newbie and I'm trying to figure out how to create a unique list of names in one column with associated group names in the next column. For example, the Name "cds" is a member of the following groups: "group1","group3","group4","group5", and "group6". I would like the output to show: |Column D | Column E | cds group1, group3–group6 I did find a Macro on a different message board that displays the unique element with the associated Group Number(s) instead of Group Name(s) .

Find the first empty row after the given row number in Excel VBA

安稳与你 提交于 2021-02-07 04:35:15
问题 I need to find the first empty row number after the given row number. please check the image below for e.g: assume, my current row number is 6 then my output should be 10. 回答1: I use CountA to see if the entire row is empty. Function FirstEmtpyRow(startRow As Long) As Long Do startRow = startRow + 1 If startRow = rpws.Count Then Exit Function Loop Until WorksheetFunction.CountA(Rows(startRow)) = 0 FirstEmtpyRow = startRow End Function 回答2: Something like this? function FindFirstEmpty(i as

Automatically run macro daily without opening any workbooks

随声附和 提交于 2021-02-07 04:19:32
问题 I am still relatively new to VBA and not too experienced with the Application.OnTime method. I have been looking at multiple resources, and I cannot see a clear way to automatically run a macro daily without opening any workbooks (assuming I run the macro first in my workbook). Is this possible? I would like to be more efficient instead of running multiple macros every morning. Let me know if you need more info but my code would simply be a copy/paste process: Sub MyMacro() Application

Automatically run macro daily without opening any workbooks

爷,独闯天下 提交于 2021-02-07 04:17:10
问题 I am still relatively new to VBA and not too experienced with the Application.OnTime method. I have been looking at multiple resources, and I cannot see a clear way to automatically run a macro daily without opening any workbooks (assuming I run the macro first in my workbook). Is this possible? I would like to be more efficient instead of running multiple macros every morning. Let me know if you need more info but my code would simply be a copy/paste process: Sub MyMacro() Application

How to attach active Excel workbook to an email

冷暖自知 提交于 2021-02-07 04:14:50
问题 I have been trying all morning to get this VBA script to attach my active excel document to an auto-generated outlook message. Everything works fine if I declare the file path as a string and attach it. Except that I would like to attach the full file path of the current excel document instead of using a static string value. Here is my code: Private Sub CommandButton1_Click() Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim sAttach As String Dim sTo As String Dim sCC As

How to attach active Excel workbook to an email

邮差的信 提交于 2021-02-07 04:13:30
问题 I have been trying all morning to get this VBA script to attach my active excel document to an auto-generated outlook message. Everything works fine if I declare the file path as a string and attach it. Except that I would like to attach the full file path of the current excel document instead of using a static string value. Here is my code: Private Sub CommandButton1_Click() Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim sAttach As String Dim sTo As String Dim sCC As

How to attach active Excel workbook to an email

那年仲夏 提交于 2021-02-07 04:12:25
问题 I have been trying all morning to get this VBA script to attach my active excel document to an auto-generated outlook message. Everything works fine if I declare the file path as a string and attach it. Except that I would like to attach the full file path of the current excel document instead of using a static string value. Here is my code: Private Sub CommandButton1_Click() Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim sAttach As String Dim sTo As String Dim sCC As

Setting an Excel Range with an Array using Python and comtypes?

我的梦境 提交于 2021-02-07 03:49:39
问题 Using comtypes to drive Python, it seems some magic is happening behind the scenes that is not converting tuples and lists to VARIANT types: # RANGE(“C14:D21”) has values # Setting the Value on the Range with a Variant should work, but # list or tuple is not getting converted properly it seems >>>from comtypes.client import CreateObject >>>xl = CreateObject("Excel.application") >>>xl.Workbooks.Open(r'C:\temp\my_file.xlsx') >>>xl.Visible = True >>>vals=tuple([(x,y) for x,y in zip('abcdefgh'