excel

Excel, convert a number with k 100k to its value 100000

橙三吉。 提交于 2021-02-05 09:31:07
问题 I have an Excel table containing values like this: 3.30k 41.30k 42.31 I would like to get the real numeric value like this: 3300 41300 42.31 Is that possible? Note the formula bar when i click a cell contains "3k" for example 回答1: Assuming Column A is not formatted as numbers, try =IF(ISNUMBER(SEARCH("k",A1)),LEFT(A1,LEN(A1)-1)*IF(RIGHT(A1)="k",1000,1),A1) 回答2: one more formula option: =SUBSTITUTE(A1,"k","")*IF(RIGHT(A1)="k",1000,1) A1 refers to your source cell. Place the above formula in in

'utf-16-le' codec can't decode bytes while reading EXCEL in PYTHON

僤鯓⒐⒋嵵緔 提交于 2021-02-05 09:28:10
问题 I am trying to read various numbers of xls files with different languages, Arabic, Greek, Italian, Hebrew, etc. and I get the error shown below when I try to call open_workbook function, any idea how can I set the format to any language? Code: book = xlrd.open_workbook(workbook_url) Error: return codecs.utf_16_le_decode(input, errors, True) UnicodeDecodeError: 'utf-16-le' codec can't decode bytes in position 372-373: unexpected end of data 回答1: It's unlikely that language is the issue. More

Return a reference to an Excel Worksheet from a PowerShell Function

天大地大妈咪最大 提交于 2021-02-05 09:01:52
问题 For the sake of code readability, I'd like to move my Excel stuff to a function and leave the worksheet object available to write cell values as my program processes stuff. How do I call a function that creates an Excel spreadsheet and return a worksheet reference so I can continue to access the open/active Excel app object I've created? Function Create-Excel-Spreadsheet() { # open excel $excel = New-Object -ComObject excel.application $excel.visible = $True # add a worksheet $workbook =

Object variable with or with block not set

家住魔仙堡 提交于 2021-02-05 09:01:31
问题 I have xml file which I am trying to parse: This is the xml file content <MYSTUFF> <COMPANYNAMES> <COMPANYNAME>JUMPIN (JIMMY) LIMITED</COMPANYNAME> <COMPANYNAME>BLADE RUNNER'S TRANSPORT</COMPANYNAME> <COMPANYNAME>P Griffiths & Sons</COMPANYNAME> <COMPANYNAME>SOMETIMES, NEVER</COMPANYNAME> <COMPANYNAME>MASTER/CLASS</COMPANYNAME> </COMPANYNAMES> <FIRSTNAMES> <FIRSTNAME>Richard</FIRSTNAME> <FIRSTNAME>Jo & hn</FIRSTNAME> <FIRSTNAME>Paul</FIRSTNAME> <FIRSTNAME>Geo, rge</FIRSTNAME> <FIRSTNAME>Ringo

Return a reference to an Excel Worksheet from a PowerShell Function

倾然丶 夕夏残阳落幕 提交于 2021-02-05 09:01:18
问题 For the sake of code readability, I'd like to move my Excel stuff to a function and leave the worksheet object available to write cell values as my program processes stuff. How do I call a function that creates an Excel spreadsheet and return a worksheet reference so I can continue to access the open/active Excel app object I've created? Function Create-Excel-Spreadsheet() { # open excel $excel = New-Object -ComObject excel.application $excel.visible = $True # add a worksheet $workbook =

Have more than one Worksheet_Change in a Worksheet

别等时光非礼了梦想. 提交于 2021-02-05 08:58:48
问题 I am looking to limit my workbook users to 1000 characters over a range of cells (Example: A5:A30) . In other words limit the total characters in the range A5:A30 to 1000 characters. When a user fills in a cell that sends the range over the 1000 character limit, it will call Application.undo which should just remove the last text that they added. However since I have another Private Sub Worksheet_Change(ByVal Targe As Range) on the worksheet, it causes a bug. Below is both Worksheet_Change

Looping through excel worksheets, in mulitple workbooks in the same directory while copying data into a new workbook

倾然丶 夕夏残阳落幕 提交于 2021-02-05 08:57:18
问题 So I have been working for a couple hours on how to get this existing code to function the way I want it to. This code by itself would loop through workbooks in a directory and copy data from specific cells on the first sheet to a new workbook. I would like to have it do that, but also go through each worksheet in each workbook to get the required data. I would post all the versions of my data that I have tried but, I'm sure that will get me banned as well. So I will post my most recent: Sub

VBA - Sub or Function not Defined

眉间皱痕 提交于 2021-02-05 08:51:58
问题 I keep getting a Sub or Function not Defined compile error with my code. What I am trying to accomplish is to take two item descriptors via input in a cell and then generate a unique alphanumeric serial number to that item and then output it onto the screen as well as save it on another sheet(which admittedly haven't even started to work on). However, I keep running into the issue of this compile error when trying to get my SerialGenerator function to work. I am trying to call the function to

VBA - Sub or Function not Defined

五迷三道 提交于 2021-02-05 08:51:02
问题 I keep getting a Sub or Function not Defined compile error with my code. What I am trying to accomplish is to take two item descriptors via input in a cell and then generate a unique alphanumeric serial number to that item and then output it onto the screen as well as save it on another sheet(which admittedly haven't even started to work on). However, I keep running into the issue of this compile error when trying to get my SerialGenerator function to work. I am trying to call the function to

Excel VBA selecting a cell getting error 1004 Select Range class failed

你说的曾经没有我的故事 提交于 2021-02-05 08:48:26
问题 The code below is a template used for a bunch of automations. all works fine until the line where i'm trying to select a certain cell. I'm doing that so that if somewhere in the code I add some code that manipulates a cell somewhere far in the document, I want it to select the first cell with data (in my case it's a variable ExcelPasteTo), so that when the user open the file,it doesn't shift to cell AZX298, for example. So far, i'm getting stuck at this line .Range(ExcelPasteTo).Select what's