excel

IF FIND function doesn't find anything in vba then

别说谁变了你拦得住时间么 提交于 2021-02-04 21:22:56
问题 I'm currently automating a manual process that does the following steps: 1.Prompts the user to open a data file and opens the file 2.Inserts 4 columns 3.Using the data that was already in the file creates a unique string in the format "DD/MM/YYYY TEXT" where text is a variable 4.Uses an if statement to determine if a row exists within the Master Data File 5.If the value in column d = "Exists" then find the string in the Master data file and use the vlookup function to transfer the data from

IF FIND function doesn't find anything in vba then

无人久伴 提交于 2021-02-04 21:20:09
问题 I'm currently automating a manual process that does the following steps: 1.Prompts the user to open a data file and opens the file 2.Inserts 4 columns 3.Using the data that was already in the file creates a unique string in the format "DD/MM/YYYY TEXT" where text is a variable 4.Uses an if statement to determine if a row exists within the Master Data File 5.If the value in column d = "Exists" then find the string in the Master data file and use the vlookup function to transfer the data from

Processing images in XLSX using Python

隐身守侯 提交于 2021-02-04 21:15:48
问题 I have an xlsx that has two sheets: on has some data in G1:O25 (let's call this "data") and one that has some images inserted into cells in G1:O25 (let's call this one "images"). My goal is to use Python to filter the data using images. I want a popup that shows me image from cell G1 along with a checkbox or something to include/exclude this data point. Then create a new sheet ("filtered data") with the included data points. I'm new to Python so bear with me, but I've figured out a couple

Why does For Each over Range.Columns(1) not iterate over cells?

北战南征 提交于 2021-02-04 21:12:17
问题 I can iterate over a range of cells to operate on each cell individually, if the range is specified by address: Dim cell as Range For Each cell In Range("A1:A10") debug.print cell.Address Next cell Produces the expected output: $A$1 $A$2 ... etc But when I specify a column from the Columns collection of a range, iteration only runs once with the whole column: For Each cell In UsedRange.Columns(1) Debug.Print cell.Address Next cell Produces just one output, with the whole column: $A$1:$A$20 Is

Why does For Each over Range.Columns(1) not iterate over cells?

余生颓废 提交于 2021-02-04 21:12:08
问题 I can iterate over a range of cells to operate on each cell individually, if the range is specified by address: Dim cell as Range For Each cell In Range("A1:A10") debug.print cell.Address Next cell Produces the expected output: $A$1 $A$2 ... etc But when I specify a column from the Columns collection of a range, iteration only runs once with the whole column: For Each cell In UsedRange.Columns(1) Debug.Print cell.Address Next cell Produces just one output, with the whole column: $A$1:$A$20 Is

Moving Worsksheet after a Named Worksheet in Excel using pywin32 Dispatch

喜夏-厌秋 提交于 2021-02-04 21:06:49
问题 I have tons of files where I need to copy a certain sheet from them to another workbook, they need to be placed after a sheet with a specific name, while keeping all the formatting in the sheet that is being moved. I saw in another thread that pywin32 would be the way to go, however I am having a hard time with copying this sheet "After" the named sheet. xl = Dispatch("Excel.Application") xl.Visible = True xl.AskToUpdateLinks = False xl.EnableEvents = False xl.DisplayAlerts = False wb1 = xl

Batch/Macro code to get latest file from FTP site

久未见 提交于 2021-02-04 19:58:38
问题 We have a shared FTP site with a daily file upload which I need to download and run checks over. I'm simply trying to automate the process. The FTP file is something like name_20150901.xml . So far I have a batch file to get the file but I can't figure out how to get the latest. Here is my code: @ftp -i -s:"%~f0"&GOTO:EOF open ftp.site.com <user> <pass> lcd my local direc binary get todaysfile_20150901.xml What changes do I need to read the files and get the newest one? My end goal is to have

Having trouble format decimal point in Excel with JasperReport

最后都变了- 提交于 2021-02-04 19:53:46
问题 I made an excel report, which contains some Double type TextFields with number format pattern ##0.# In OpenOffice, these cells are formatted correctly (Which is exactly what I need) 1.56 -> 1.6 0.0 -> 0 However, when I opened report with Microsoft Excel, the decimal point did not disappear like I excpected. 1.56 -> 1.6 0.0 -> 0. After some search, I found a post about number format in Excel. In Excel format number with optional decimal places I tried [=0]0;.# instead as the post suggested.

python: converting corrupt xls file

北城以北 提交于 2021-02-04 19:41:05
问题 I have downloaded few sales dataset from a SAP application. SAP has automatically converted the data to .XLS file. Whenever I open it using Pandas library I am getting the following error: XLRDError: Unsupported format, or corrupt file: Expected BOF record; found '\xff\xfe\r\x00\n\x00\r\x00' When I opened the .XLS file using MSEXCEL it is shows a popup saying that the file is corrupt or unsupported extension do you want to continue when I clicked 'Yes' its showing the correct data. When I

VBA code to select from an HTML drop down, using value rather than index

假装没事ソ 提交于 2021-02-04 19:35:09
问题 I'm fairly new to VBA and HTML. I am writing a VBA macro which navigates through a website, before filling in a web form. During navigation, the script needs to pick an option from a drop-down menu. I am currently using the following (no doubt awful, but functional) code, which finds the correct drop-down menu before selecting the option at index 2. Set dropOptions = HTMLDoc.getElementsByTagName("select") For Each op In dropOptions If op.getAttribute("name") = "tilastojakso" Then op.Focus op