excel

Excel macro to concatenate one row at a time to end of file

空扰寡人 提交于 2021-02-10 05:49:09
问题 I need an Excel macro to join seven columns of data on each row until the end of the data is reached. For example if I have a formula like this: =A1&B1&C1&D1&E1&F1&G1 How can I write the macro so that it increments for every row to the end of the file in a sequence like this? =A1&B1&C1&D1&E1&F1&G1 =A2&B2&C2&D2&E2&F2&G2 =A3&B3&C3&D3&E3&F3&G3 回答1: With so many answers, the main focus on what assylias and I were highlighting has gone to waste :) However, if you still want a VBA answer. Use this

how to delete a duplicate column read from excel in pandas

馋奶兔 提交于 2021-02-10 05:41:05
问题 Data in excel: a b a d 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 Code: df= pd.io.excel.read_excel(r"sample.xlsx",sheetname="Sheet1") df a b a.1 d 0 1 2 3 4 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 how to delete the column a.1 ? when pandas reads the data from excel it automatically changes the column name of 2nd a to a.1. I tried df.drop("a.1",index=1) , this does not work. I have a huge excel file which has duplicate names, and i am interested only in few of columns. 回答1: If you know the name of the column you

How to read xslx with open XML SDK based on columns in each row in C#?

若如初见. 提交于 2021-02-10 05:31:09
问题 I am trying to read some .xslx files with the open xml sdk, but I'm really struggeling finding any good examples. What I want to do is to read the entire XSLX file and loop through all of the rows and extract the cellvalue/celltext from the columns i specify. Like the following: GetCellText(rowId, ColumnLetter) Is this possible? 回答1: Helpers: private static string GetColumnName(string cellReference) { if (ColumnNameRegex.IsMatch(cellReference)) return ColumnNameRegex.Match(cellReference)

How to read xslx with open XML SDK based on columns in each row in C#?

折月煮酒 提交于 2021-02-10 05:30:40
问题 I am trying to read some .xslx files with the open xml sdk, but I'm really struggeling finding any good examples. What I want to do is to read the entire XSLX file and loop through all of the rows and extract the cellvalue/celltext from the columns i specify. Like the following: GetCellText(rowId, ColumnLetter) Is this possible? 回答1: Helpers: private static string GetColumnName(string cellReference) { if (ColumnNameRegex.IsMatch(cellReference)) return ColumnNameRegex.Match(cellReference)

Separate address elements from 1 cell in Excel

≯℡__Kan透↙ 提交于 2021-02-10 05:27:16
问题 I have thousands of addresses in this format: 123 Happy St. Kansas City, MO 64521 9812 Main Street Minneapolis, MN 62154 12 Virgina Ave, Apt 8, Dallas, TX 54334 I want to extract the address, city, state, zip into individual cells (without using VB if possible). I've tried a couple variations of other methods posted, but I can't quite get desired results. 回答1: Analyze your problem! you want to split your address string at the comma you then want to split the right fragment from (1) at the

Separate address elements from 1 cell in Excel

偶尔善良 提交于 2021-02-10 05:26:14
问题 I have thousands of addresses in this format: 123 Happy St. Kansas City, MO 64521 9812 Main Street Minneapolis, MN 62154 12 Virgina Ave, Apt 8, Dallas, TX 54334 I want to extract the address, city, state, zip into individual cells (without using VB if possible). I've tried a couple variations of other methods posted, but I can't quite get desired results. 回答1: Analyze your problem! you want to split your address string at the comma you then want to split the right fragment from (1) at the

Separate address elements from 1 cell in Excel

我的未来我决定 提交于 2021-02-10 05:26:12
问题 I have thousands of addresses in this format: 123 Happy St. Kansas City, MO 64521 9812 Main Street Minneapolis, MN 62154 12 Virgina Ave, Apt 8, Dallas, TX 54334 I want to extract the address, city, state, zip into individual cells (without using VB if possible). I've tried a couple variations of other methods posted, but I can't quite get desired results. 回答1: Analyze your problem! you want to split your address string at the comma you then want to split the right fragment from (1) at the

How to prevent Excel import in SSIS package when there is no file to process?

冷暖自知 提交于 2021-02-10 05:15:39
问题 I have an SSIS package that imports Excel files. Inside the package, I have a Script task that checks whether the Excel file exists or not before executing the Excel import process. I am unable to execute the package when the Excel file doesn't exist because of the AcquireConnection error. How can I prevent the package from executing when there is no Excel file available for import? 回答1: Perform the following steps to avoid the package from failing. Set the ValidateExternalMetadata property

How to prevent Excel import in SSIS package when there is no file to process?

谁都会走 提交于 2021-02-10 05:15:12
问题 I have an SSIS package that imports Excel files. Inside the package, I have a Script task that checks whether the Excel file exists or not before executing the Excel import process. I am unable to execute the package when the Excel file doesn't exist because of the AcquireConnection error. How can I prevent the package from executing when there is no Excel file available for import? 回答1: Perform the following steps to avoid the package from failing. Set the ValidateExternalMetadata property

VBA Excel Replace last 2 digits of number if occurs at beginning of string

好久不见. 提交于 2021-02-10 05:14:25
问题 I'm trying to replace the last two digits of number with " XX BLOCK " if it occurs at the start of the string and has more than 2 digits. I'm using the Microsoft VBScript Regular Expressions 5.5 reference. Dim regEx As New RegExp With regEx .Global = True 'Matches whole string, not just first occurrence .IgnoreCase = True 'Matches upper or lowercase .MultiLine = True 'Checks each line in case cell has multiple lines .pattern = "^(\d{2,})" 'Checks beginning of string for at least 2 digits End