excel

Add unique Id to list of numbers - VBA

a 夏天 提交于 2021-01-29 03:38:54
问题 I have a list of numbers (50,000+) and I need to add a Id to the end of each unique group. The Id is in a format of "-###". 151022 151022 151020 150922 150715 150911 151014 151021 151020 151019 151019 151019 151020 I need it to print like this 151022-001 151022-002 151020-001 150922-001 150715-001 150911-001 151014-001 151021-001 151020-002 151019-001 151019-002 151019-003 151020-002 I currently have this code that I found and modified slightly. If I could get it to start counting unique

Python win32com 'Invalid number of parameters'

可紊 提交于 2021-01-29 03:33:30
问题 I am trying to use win32com to convert multiple xlsx files into xls using the following code: import win32com.client f = r"./input.xlsx" xl = win32com.client.gencache.EnsureDispatch('Excel.Application') wb = xl.Workbooks.Open(f) xl.ActiveWorkbook.SaveAs("./somefile.xls", FileFormat=56) which is failing with the following error: Traceback (most recent call last): File "xlsx_conv.py", line 6, in <module> xl.ActiveWorkbook.SaveAs("./somefile.xls", FileFormat=56) File "C:\python27\lib\site

Find Max Value in Column if meets criteria and return corresponding cell value?

浪子不回头ぞ 提交于 2021-01-29 03:14:19
问题 I have a spreadsheet with times and tasks like so: Company: PG Limited Task Time A 1 B 7 C 9 A 10 Company: BP Limited Task Time A 7 B 3 C 1 A 1 I want to find the max value in my Time column where the task is "A" and return the company name. Can this be done? I would really appreciate help with this. Here's my max formula: =MAX(IF('Total Data'!D:D="A",'Total Data'!E:E)) Here's the adapted formula where i have tried using index match =INDEX('Total Data'!E:E,MATCH(MAX(IF('Total Data'!D:D="Total

Excel-vba: Pasting Image only from Clipboard + allowing for re-use later

[亡魂溺海] 提交于 2021-01-29 03:11:52
问题 I would like to do allow the user to do following in excel. This would probably be achieved using macros. User takes a screenshot, like with Snipping Tool Code checks if the clipboard contains an image or not (code only to run only when clipboard holds an image) Code will then paste the image from clipboard onto a specified area (e.g. Cell J55). At the same time, I want to give this pasted image an ID (say, imgSource1), so that the user can later re-use this image on another sheet (say, on

R squared as measure in Excel Power Pivot

感情迁移 提交于 2021-01-29 03:10:36
问题 Is there a simple way to caclulate the R^2 value in a Power Pivot? In 'normal' excel, we can use the RSQ function but that function doesn't exist among the Measure functions in Power Pivot. 回答1: Short answer: No. There's no native DAX equivalent of the Excel RSQ function. You could create DAX calculations to determine the Pearson correlation (example) or you could use R script (example) 回答2: As @Olly says, there isn't a built-in equivalent but the formula is not too difficult to write

Vba Import CSV files to Excel

好久不见. 提交于 2021-01-29 03:03:41
问题 I'm trying to import Csv file to excel using VBA code, I want it to work with all Csv files but it didn't. Here is my code: Sub Input_CSV() Dim Wb As String Dim Arr Set Wb = GetObject(Application.GetOpenFilename("csv file,*.csv", , "please choose a csv file", , False)) Dim blnImportData As Boolean blnImportData = ImportCSV(Wb, "Sheet1", "A1") If blnImportData Then MsgBox "Import CSV process complete", vbInformation, ThisWorkbook.Name _ Else MsgBox "Import CSV process failed", vbCritical,

Find Max Value in Column if meets criteria and return corresponding cell value?

夙愿已清 提交于 2021-01-29 03:00:14
问题 I have a spreadsheet with times and tasks like so: Company: PG Limited Task Time A 1 B 7 C 9 A 10 Company: BP Limited Task Time A 7 B 3 C 1 A 1 I want to find the max value in my Time column where the task is "A" and return the company name. Can this be done? I would really appreciate help with this. Here's my max formula: =MAX(IF('Total Data'!D:D="A",'Total Data'!E:E)) Here's the adapted formula where i have tried using index match =INDEX('Total Data'!E:E,MATCH(MAX(IF('Total Data'!D:D="Total

Writing to Excel with Open Xml gives issue after certain columns

偶尔善良 提交于 2021-01-29 02:57:08
问题 I am using C# with Open XML Format SDK 2.0, Trying to write an Excel report file. My problem is when I cross the Z column (reaching AA) the file goes corrupted and cannot be open manually by the user. Any ideas? static void Main(string[] args) { PortfolioReport report = new PortfolioReport("Keywords"); report.CreateReport(); } public PortfolioReport(string client) { string newFileName = path + client + ".xlsx"; if (File.Exists(newFileName)) { File.Delete(newFileName); } FileInfo newFile = new

VBA to check if any cell is not blank in given range

僤鯓⒐⒋嵵緔 提交于 2021-01-29 02:56:13
问题 I have the below code that will throw a prompt when a particular sheet is empty before saving the workbook. Purpose of code: To check, if value of drop-down is "yes" in Main Sheet and if "yes", check if given range on a particular sheet is blank. If "yes", throw a prompt and change the drop down value to "No" on main sheet. Concern: For loop in the code will check if any cell is empty in given range, instead, I want a code to check if there is an entry in any one cell in given range. Lets say

How to use time format excel cell in laravel uploaded excel?

こ雲淡風輕ζ 提交于 2021-01-29 02:53:32
问题 i am using laravel package maatwebsite/excel version 3.1 for excel file upload. $collection = Excel::toCollection(new UsersImport, storage_path('app/' . $newFile)); i have uploaded a file where the format of cell is time. Here time in and time out cell has time format. when i upload this file the resulting output is: in resulting output time in and time out cells data is converted into string. how to prevent this from converting or how to change this from text to time? 回答1: You need to