Global web icon
stackoverflow.com
https://stackoverflow.com/questions/tagged/vba?tab…
Newest 'vba' Questions - Stack Overflow
Visual Basic for Applications (VBA) is an event-driven programming language which was first introduced by Microsoft in 1993 to give Excel 5.0 a more robust object-oriented language for writing macros and automating the use of Excel.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/6028288/proper…
Properly Handling Errors in VBA (Excel) - Stack Overflow
Block 2 looks like an imitation of a Try/Catch block. It should be okay, but it's not The VBA Way. Block 3 is a variation on Block 2. Block 4 is a bare-bones version of The VBA Way. I would strongly advise using it, or something like it, because it's what any other VBA programmer inherting the code will expect. Let me present a small expansion ...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/6627652/parsin…
Parsing JSON in Excel VBA - Stack Overflow
87 I have the same issue as in Excel VBA: Parsed JSON Object Loop but cannot find any solution. My JSON has nested objects so suggested solution like VBJSON and vba-json do not work for me. I also fixed one of them to work properly but the result was a call stack overflow because of to many recursion of the doProcess function.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/11169445/find-…
Find last used cell in Excel VBA - Stack Overflow
See my solution based on UsedRange and VBA arrays to find the last cell with data in the given column -- it handles hidden rows, filters, blanks, does not modify the Find defaults and is quite performant. Whatever solution you pick, be careful
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/37689847/creat…
excel - Creating an Array from a Range in VBA - Stack Overflow
slicedArr = Application.WorksheetFunction.index(arr, 1, 0) 'If you set row_num or column_num to 0 (zero), Index returns the array of values for the entire column or row, respectively._ 'To use values returned as an array, enter the Index function as an array formula in a horizontal range of cells for a row,_ 'and in a vertical range of cells ...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/16943003/vba-t…
VBA to copy a file from one directory to another - Stack Overflow
I have an access file that I regularly need to copy to another directory, replacing the last version. I would like to use an Excel macro to achieve this, and would also like to rename the file in the
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/12199318/vba-s…
VBA: Selecting range by variables - Stack Overflow
I want to select the formatted range of an Excel sheet. To define the last and first row I use the following functions: lastColumn = ActiveSheet.UsedRange.Column - 1 + ActiveSheet.UsedRange.Columns.
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/25056372/vba-r…
excel - VBA - Range.Row.Count - Stack Overflow
Sub test() Dim sh As Worksheet Set sh = ThisWorkbook.Sheets("Sheet1") Dim k As Long k = sh.Range("A1", sh.Range("A1").End(xlDown)).Rows.Count End Sub What happens is this: We count the rows which contain values starting at A1. If the number of rows which contain values is > 1 the code works great. However, if A1 is the only cell which contains any value, k = 1,048,576 which I guess is the ...
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/17173898/how-t…
How to do a "Save As" in vba code, saving my current Excel workbook ...
I have an Excel Workbook that on form button click I want to save a copy of the workbook with the filename being the current date. I keep trying the the following ActiveWorkbook.SaveAs ("\\\\filePath\\
Global web icon
stackoverflow.com
https://stackoverflow.com/questions/6934169/how-to…
How to show current user name in a cell? - Stack Overflow
In most of the online resource I can find usually show me how to retrieve this information in VBA. Is there any direct way to get this information in a cell? For example as simple as =ENVIRON('Use...