How do I slice an array in Excel VBA?

Application.WorksheetFunction.Index(array, row, column) If you specify a zero value for row or column, then you’ll get the entire column or row that is specified. Example: Application.WorksheetFunction.Index(array, 0, 3) This will give you the entire 3rd column. If you specify both row and column as non-zero, then you’ll get only the specific element. There is no … Read more

Fastest function to generate Excel column letters in C#

I currently use this, with Excel 2007 public static string ExcelColumnFromNumber(int column) { string columnString = “”; decimal columnNumber = column; while (columnNumber > 0) { decimal currentLetterNumber = (columnNumber – 1) % 26; char currentLetter = (char)(currentLetterNumber + 65); columnString = currentLetter + columnString; columnNumber = (columnNumber – (currentLetterNumber + 1)) / 26; } … Read more

Reading excel file in Reactjs

I have successfully read excel file using Sheetjs‘s npm version xlsx. Here is code: import * as XLSX from ‘xlsx’; //f = file var name = f.name; const reader = new FileReader(); reader.onload = (evt) => { // evt = on_file_select event /* Parse data */ const bstr = evt.target.result; const wb = XLSX.read(bstr, {type:’binary’}); … Read more

How do I convert a Unix epoch timestamp into a human readable date/time in Excel?

Yes, you can create a formula to do this for you. Java and Unix/Linux count the number of milliseconds since 1/1/1970 while Microsoft Excel does it starting on 1/1/1900 for Windows and 1/1/1904 for Mac OS X. You would just need to do the following to convert: For GMT time on Windows =((x/1000)/86400)+(DATEVALUE(“1-1-1970”) – DATEVALUE(“1-1-1900”)) … Read more

Import Excel Data into PostgreSQL 9.3

The typical answer is this: In Excel, File/Save As, select CSV, save your current sheet. transfer to a holding directory on the Pg server the postgres user can access in PostgreSQL: COPY mytable FROM ‘/path/to/csv/file’ WITH CSV HEADER; — must be superuser But there are other ways to do this too. PostgreSQL is an amazingly … Read more

Copy Paste Values only( xlPasteValues )

If you are wanting to just copy the whole column, you can simplify the code a lot by doing something like this: Sub CopyCol() Sheets(“Sheet1”).Columns(1).Copy Sheets(“Sheet2”).Columns(2).PasteSpecial xlPasteValues End Sub Or Sub CopyCol() Sheets(“Sheet1”).Columns(“A”).Copy Sheets(“Sheet2”).Columns(“B”).PasteSpecial xlPasteValues End Sub Or if you want to keep the loop Public Sub CopyrangeA() Dim firstrowDB As Long, lastrow As Long … Read more