excel

Correct way to offset headers while looping through a filtered list?

此生再无相见时 提交于 2021-01-29 08:33:15
问题 In the below code i'm trying to use a for loop through a filtered list. Without the offset the loop is going through each field and copying the data multiple times. With the offset its skipping rows. How can I rephrase this to only loop through each row once, and skip the header row? 'Offset Placement Wrong Set rngVisible = activeSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible).Offset(1, 0) For Each rngCell In rngVisible Rows(rngCell.Row).Select Selection.Copy Sheets(2).Select 'Skip

EPPlus Problem Creating List Validation from Table on another spreadsheet

蓝咒 提交于 2021-01-29 08:32:49
问题 I've created a table on one worksheet (list of state names) and named the table "tblStates". Then, on a second worksheet, there is a column for State where I want list validation for those cells, in which each cell has a dropdown offering the state names from the "tblStates" table. So for the State column in the 2nd worksheet, I created a table named "tblGeoStates" and added list validation to the column that references "=tblStates". (I referenced this article/video, although I don't have a

How to use an IF statement to pull cells only with >= XXXX

南楼画角 提交于 2021-01-29 08:32:29
问题 I'm trying to look at the number of users who are on screens larger than 1400. I have my Excel sheet, and tried doing an IF statement, but because of the "x" in the middle, it's not working properly and is instead just pulling all of the cells, even the ones with screen sizes less than 1400. I've attached my formula and data example for reference. I've also tried putting a space after the fourth integer to separate things that way, but that also goofs things up since there are some screen

How to replace or update “Style” attribute value by using VBA

旧巷老猫 提交于 2021-01-29 08:31:43
问题 I am feeding Data on website using VBA. I am want to change/replace or update the value of "Style" attribute on that website. HTML <div class="timeline-row-item style="left: 556px;"></div> I want to change the value from style="left: 556px;" to style="left: 300px;" Sub test1() Dim IE As New SHDocVw.InternetExplorer IE.document.querySelectorAll("div[class*= timeline-row-iteml]").setAttribute ("style", left: 300px;") How can i do this on Excel VBA. Thank You 回答1: querySelectorAll returns a

How to close an Excel instance if the Python console program gets interrupted and closed?

扶醉桌前 提交于 2021-01-29 08:31:27
问题 I'm trying to figure out how to close an Excel instance properly if the Python console program is interrupted and closed while executing. Below is a minimal reproducible example: # import pythoncom import traceback import win32com.client import win32api def exit_handler(arg): file = open('Log.txt', 'w') file.write(f'{repr(workbook)}\n{repr(excel_application)}\n') try: # pythoncom.CoInitialize() workbook.Close(SaveChanges=False) excel_application.Quit() except Exception: file.write(traceback

Apache POI: Force celldata type to be NO formula?

天大地大妈咪最大 提交于 2021-01-29 08:30:25
问题 Adding pure text from a different source, i noticed Apache POI (3.17) automatically assumes a String starting with = is interpreted as a formula. This is usually fine, but how can i make sure that in this special case, the cell is NOT a formula? I assumed after adding the String starting with = , i can just tell Apache POI the type is CellType.STRING : cell.setCellType(CellType.STRING); But this does not yield the expected result, the String is still read as a formula in the output .xlsx file

randomize a list of numbers atomaticaly without duplicates in excel

眉间皱痕 提交于 2021-01-29 08:20:37
问题 Hi I have a list of facilities ID starting from cell E8 and the number of facilities on cell E2. I want to get random Facility IDs from column E8 and transfer to column F (Facility ID PICKED) starting from cell F8. I want this to be automatically if possible, so everytime there is a new desired number(in this case 61) then the random facilities get picked automatically. I was using a formula but then I realized it was bringing me duplicate IDs. I only one each to be picked once. Please any

find the first “To Date”, select the cells under “To Date” paste the value in the previous cells then go to the next To Date

坚强是说给别人听的谎言 提交于 2021-01-29 08:18:42
问题 I need your help in order to fix this code. Objective of this code is set a range. find the first "To Date", then select all the cells under "To Date" paste the value in the previous cells (for example the first "To Date" is in cell F4 contains value from F5:F"N"(N=last row) then paste F5:F"N" values in E5:E"N", then go to the next To Date. The problem I am facing in this code is that the Code does not select the last row in under the "To Date" (except for the first time) the code runs in

Populate a combobox in DropButtonClick

怎甘沉沦 提交于 2021-01-29 08:18:22
问题 I am trying to populate a combobox as it is needed, by doing the population in the DropButtonClick function. As a simple example: Private Sub cmbAdvisor_DropButtonClick() cmbAdvisor.Clear cmbAdvisor.AddItem ("Test1") cmbAdvisor.AddItem ("Test2") End Sub This works fine, and the values are shown in the drop down list. However, when I click on one of them, the drop down list goes away, and the combobox now displays nothing/blank. I would expect it to display the item that I had selected. I'm

Running a MS Word mail merge from excel

泄露秘密 提交于 2021-01-29 08:17:02
问题 I know this has been asked before and I tried to update the other thread but was not allowed. I have a spreadsheet that has data that is used in a MS mail merge. I have a Word mail merge document that is all set up to run. The fields are already set up. When I open the word doc I get a prompt that says "Opening this document will run the following SQL command", etc, etc. What I want to do is have the Excel spreadsheet run the mail merge without any user intervention when I click a button. I