excel

How to select the first visible row after applying a filter

邮差的信 提交于 2021-02-11 15:35:00
问题 I'm filtering a table in Excel but I only want the first line that appears. 回答1: Use Range.SpecialCells method with the xlCellTypeVisible parameter on the filtered range. .Rows(1).Cells should be what you want. Sub first_row() Dim rFirstFilteredRow As Range With Worksheets("Sheet1") With .Cells(1, 1).CurrentRegion 'do all the .autofilter stuff here With .Resize(.Rows.Count - 1, .Columns.Count).Offset(1, 0) If CBool(Application.Subtotal(103, .Cells)) Then Set rFirstFilteredRow = _

how to write an if statement code to compare two cell's value in one sheet to another cell in another sheet

拈花ヽ惹草 提交于 2021-02-11 15:34:38
问题 i have two columns (Start Date, End Date) and i want a code that changes the color of both their cells to red if the start date and end date contained any date located in another sheet I tried using conditional formatting using this rule: =AND(C2<=Holidays!$A$2:$A$15,D2>=Holidays!$A$2:$A$15) 回答1: Tested out the below formula for myself and think it should work! Effectively rather than a simple AND statement, since we're comparing against an array of values rather than single cells, we need to

how to write an if statement code to compare two cell's value in one sheet to another cell in another sheet

二次信任 提交于 2021-02-11 15:34:23
问题 i have two columns (Start Date, End Date) and i want a code that changes the color of both their cells to red if the start date and end date contained any date located in another sheet I tried using conditional formatting using this rule: =AND(C2<=Holidays!$A$2:$A$15,D2>=Holidays!$A$2:$A$15) 回答1: Tested out the below formula for myself and think it should work! Effectively rather than a simple AND statement, since we're comparing against an array of values rather than single cells, we need to

What VBA event allows to capture click value of ActiveX combobox?

大兔子大兔子 提交于 2021-02-11 15:30:09
问题 After choosing item from ActiveX combobox by mouse click I would like the combobox to be closed and the item to be chosen. Here is an example. I have tried TempCombo_Click event but it is fired AFTER the TempCombo_Change event. And when I select item by click, my search string passed to TempCombo_Change event is empty. So I need something to preserve item selection in TempCombo_Change event. I use modification of VBA code taken from Autocomplete suggestion in Excel data validation list again

What VBA event allows to capture click value of ActiveX combobox?

北城以北 提交于 2021-02-11 15:28:24
问题 After choosing item from ActiveX combobox by mouse click I would like the combobox to be closed and the item to be chosen. Here is an example. I have tried TempCombo_Click event but it is fired AFTER the TempCombo_Change event. And when I select item by click, my search string passed to TempCombo_Change event is empty. So I need something to preserve item selection in TempCombo_Change event. I use modification of VBA code taken from Autocomplete suggestion in Excel data validation list again

How to insert a real pivot table in a excel sheet with python?

泄露秘密 提交于 2021-02-11 15:24:47
问题 I want to create a "real" pivot table in excel sheet with python without using the function of pandas (pandas.pivot_table). Is there a method? I need to create the "true" pivot table in excel with a dropdown combo box. Unfortunately the pandas pivot is static (is a table) and not dynamic. Can anyone help me? 回答1: Can you try it this way? import win32com.client Excel = win32com.client.gencache.EnsureDispatch('Excel.Application') # Excel = win32com.client.Dispatch('Excel.Application') win32c =

trying to launch a macro when the value of a DDE range changes

我们两清 提交于 2021-02-11 15:21:34
问题 I'm a novice in VBA but still I need yo execute a macro every time the value of a range changes. The marco is already written but if someone can help me with this issue, I will be very grateful. Just as you know the changing range is a DDE link updating the range with a continuous flow Thxs for your help 回答1: I think you are referring to Excel, so this may help: automatically execute an Excel macro on a cell change 来源: https://stackoverflow.com/questions/2409060/trying-to-launch-a-macro-when

Docx4J Generated XLSX file is always corrupt

三世轮回 提交于 2021-02-11 15:19:14
问题 TL;DR: Excel Workbook generated by Docx4J always says corrupted but I can't determine what Excel doesn't like about the underlying XML, let alone how to fix it. My use case is as follows: I am trying to produce an excel workbook with charts and graphs automatically on a regular basis. Only the raw data will change but everything else will dynamically update as the raw data is changed. So I built an excel workbook which has a number of charts and graphs being generated by a sheet of raw data.

Transposing Data in Pandas

只谈情不闲聊 提交于 2021-02-11 15:15:55
问题 I have an excel file that contains a count of how many times an Part has been used during its lifespan. The data is currently stored in such a way that the Serial numbers are in Column A, and each "Lifespan" Count is stored in adjacent columns, with a "Date" value as its heading. Here is an example: Image1 I want to be able to pivot/transpose ALL of the Date columns in Python so that the output is in the following format with the Lifespan Count as a new column named "Count": Image2 I've tried

Excel Macro creates .tmp files?

孤街浪徒 提交于 2021-02-11 15:10:28
问题 One of my macros seems to be creating and saving .tmp files in the folder where I keep my excel files. By now these files are piling up in my folders. I noticed that when I save the macro excel file a .tmp shortly appears in the same folder but then sometimes it is not deleted. How can I stop the macro from creating these files? I tried switching off autosave but that doesn't help. The .tmp files look something like this: 5E84EFBE.tmp 来源: https://stackoverflow.com/questions/58083069/excel