excel

Get all Workbook Range Names sorted by Order in Worksheet with VBA?

走远了吗. 提交于 2021-01-29 08:11:53
问题 I am coding a number of forms (possibly ultimately many dozens, all variants of one main template) into separate flat databases. Each form has over 2 - 300 fields that are unique entries. After assigning range names to all these fields, when I get a list of Range Names using the Formulas->Use in Formula->Paste Names->List , I get all the Named Ranges but they are sorted alphabetically. I need these in the order they appear in the Data Entry Form, sorted by row, then column. By using the Right

Excel VBA: Displaying table data using drop down list

情到浓时终转凉″ 提交于 2021-01-29 08:11:38
问题 I am a beginner in VBA. I have a worksheet in Excel where tables for each individual month is created to calculate the total amount of manhours for each month. The tables are located in different columns in the worksheet. The data in this table is populated using manually inputted data in respective sheets created for each month. Currently, this is being done manually and the list is getting very long. I would like to improve on this by creating a dropdown list filter and retrieving the

VBA Paste Value to Next Empty Cell in a Range

与世无争的帅哥 提交于 2021-01-29 08:11:10
问题 I'm trying to copy and paste a value from one sheet (C39 on Sheet1) to the next empty cell within a range on another sheet (B6 through B18 on Sheet2). Here's the code I'm using. Sheets("Sheet1").Range("C39").Copy With Sheets("Sheet2").Range("B6:B18").End(xlUp).Offset(1) .PasteSpecial Paste:=xlPasteValues End With End Sub When I run this macro, it continues to overwrite B6 on Sheet2. Ideally, it'd see there's a value in B6 and paste into B7, and then B8, etc. What can I do to correct this? 回答1

How to loop through XML-nodes and validate if values exists?

三世轮回 提交于 2021-01-29 08:09:14
问题 I have through an API fetched my data as an XML, and I wish to cycle through nodes (there are several of the same type) and add them to certain fields/a table. Example from the XML-file: <HistRating xmlns=""> <EndrAr>2020</EndrAr> <EndrMnd>7</EndrMnd> <Rating>A</Rating> </HistRating> <HistRating xmlns=""> <EndrAr>2019</EndrAr> <EndrMnd>6</EndrMnd> <Rating>A</Rating> </HistRating> I have tried the following format (at this point the XML I need is in a string in xmlDoc xmlDoc = CreateObject(

How to set the last data row excel macro

孤者浪人 提交于 2021-01-29 08:06:58
问题 I'm trying to make a macro to help me in format some files, but each file has different number of rows (but always same number of columns). I defined the last range as 99999 because i don't know how to make the macro recognize the last row with some data and stop there. Someone can help? Thank you Rows("1:26").Select Selection.Cut Sheets.Add After:=ActiveSheet ActiveSheet.Paste Range("C16").Select Sheets("teste").Select Selection.Delete Shift:=xlUp Range("I3:N99999").Select Selection.Cut

using other mail account by sending mail from Excel to outlook [duplicate]

巧了我就是萌 提交于 2021-01-29 08:05:41
问题 This question already has answers here : choose account in outlook when send mail via excel vba [duplicate] (1 answer) MS Access / Outlook 2010 - how to choose which account to send email from? (2 answers) VBA Send Email from Second Outlook Email Address (1 answer) How to send mail from a specific account? (1 answer) Closed 4 months ago . I have this macro running in VBA. it is to send a mail out of Excel using Outlook. Now i have two accounts on outlook, let's say Test1@outlook.com and Test2

Selecting multiple specific columns in excel and exporting to CSV using Python

心不动则不痛 提交于 2021-01-29 07:52:55
问题 I'm trying to extract 3 columns in a large excel spreadsheet and export it to CSV format. I have XLRD but have found that there are no column specific tools I can use (Or maybe I just overlooked it). An example excel spreadsheet I have looks like the following Column1 Column2 Column3 Column4 Column5 Column6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 I'm looking to get just Column2, Column5, and Column6 into a CSV. The other columns are for

If logic where either of two conditions make it true

时光毁灭记忆、已成空白 提交于 2021-01-29 07:50:27
问题 I am trying to delete a row if cells in column V is not equal to F or V. This code deletes everything. For i = RowCount To 1 Step -1 If Range("V" & i).Value <> "F" Or Range("V" & i).Value <> "V" Then Rows(i).Delete Next i 回答1: Your logic seems incorrect. By changing the or to an and , you will then be evaluating the proper boolean arithmetic. Right now, you are checking not "v" and not "f" which is always false. No matter the input, this will always have answer be true. 回答2: Answer to Else

How to get full selection from Excel sheet using VBA without the filtered rows that are in between

蹲街弑〆低调 提交于 2021-01-29 07:50:13
问题 I am trying to get a selection from a worksheet in Excel using VBA, to use this selection as input for a next step of analysis on the data. This works fine, until you make a selection that has filtered rows in between. In that case it will only get the part of the range that is before the filtered rows. How can I also get the selected row(s) after the filtered rows? Below is the code that I use for getting the selected rows from the sheet, and an example of a selection where the code does not

Excel Formula not updating

a 夏天 提交于 2021-01-29 07:44:53
问题 This is a weird one. I have an excel file with formulas which is emailed back and forth between users in different countries (different language settings more than likely). To get the formulas to calculate, you hit enable editing which calculates all the formulas in the workbook. On windows 10, I receive a file and when I hit enable editing, the formulas do not calculate unless I manually go into each one and hit return. If I open the same file from windows 8, it calculates. The formulas are