Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 129674

Microsoft Excel is a commercial spreadsheet application written and distributed by Microsoft.

4 votes
Accepted

Verify items and prices in a large Excel sheet

You are correct that this code can be simplified. The posted code was almost certainly created using Copy-Paste (19 times) followed by changing a single variable within the block. When code is creat …
BZngr's user avatar
  • 1,217
2 votes
Accepted

Identify Anonymous orders in BOM list & update accordingly, execute time is taking very long

The code cycles thru the remainder of dArray even after meeting the logic condition for setting an mArray element to 'Anonymous'. This is inefficient since replacing the vbNullString once is suffici …
BZngr's user avatar
  • 1,217
4 votes
Accepted

Class to organise frames on an Excel userform

A simple search on 'Implement an Interface in Excel VBA' will provide the rest of the details to get to the following version of CFrameSorter: Option Explicit Implements IFrameSorter Private …
BZngr's user avatar
  • 1,217
2 votes
Accepted

Optimising Read/Write Speed of Excel VBA Copy/Paste Macro

Option Explicit (Best Practice) Always declare Option Explicit at the top of your modules. This allows the compiler to flag the use of variables that have not been explicitly declared. This helps to …
BZngr's user avatar
  • 1,217
3 votes
Accepted

VBA Automatic insert in a Excel Spreadsheet

The comments I have fall into three categories that relate to general programming practices that would be applicable to any language, not just VBA. Raw Strings Don't Repeat Yourself (DRY) Single …
BZngr's user avatar
  • 1,217
2 votes
Accepted

aggregate sheets from many excel workbooks into one workbook

I think the way you are doing this is reasonable. Regarding pre-existing blank sheets..The rewritten code below removes blank worksheet(s) in the importing workbook, after the selected workbooks' wor …
BZngr's user avatar
  • 1,217
3 votes
Accepted

Best way to copy data to a new sheet and reorganize it (VBA)

Some comments that you hopefully find useful: (Best Practice)Declare "Option Explicit" at the top of every module. This option requires that every variable used in the module is explicitly declared. …
BZngr's user avatar
  • 1,217
1 vote

Excel Data Import and Manipulation

be confirm that the DB to import is stored in the REGISTER tab of the file") 'Opening the File and copy to my workbook Dim fileName As Variant fileName = Application.GetOpenFilename(FileFilter:="Excel
BZngr's user avatar
  • 1,217
6 votes
Accepted

Excel Data Import and Manipulation

String) Dim timestamp As String, logEntry As String timestamp = Format(Now, "mm/dd/yyyy HH:mm:ss") logEntry = message & ": " & timestamp 'Append logEntry to a text file or write them out to an excel … Worksheets If TempSheetName = UCase(Sheet.Name) Then MsgBox "Reset before importing" Exit Sub End If Next Sheet 'File opening FilePath = Application.GetOpenFilename(FileFilter:="Excel
BZngr's user avatar
  • 1,217
3 votes

Checking if date falls within a date range then write the date range to a cell

When your users open this workbook, the Excel application/workbook becomes the initial User-Interface. …
BZngr's user avatar
  • 1,217
2 votes

VBA, Data Split Into Two Rows, Convert To One Loop Optimization

It is always a speed improvement to set variables external to a loop so long as the value is remains constant within the loop. So, the first change to improve performance here would be: Prefer instant …
BZngr's user avatar
  • 1,217
1 vote

VBA - Compare & Consolidate Dynamic Arrays

More information If you are interested in more information about best/better coding practices demonstrated using VBA, I would recommend you visit RubberDuck and consider using the free RubberDuck Excel
BZngr's user avatar
  • 1,217
12 votes

Small datasheet code running super slow on Excel VBA

You do not have look at more than about 2 Code Review answers to find posts that advocate two very important principles when writing code (in VBA or any other language). The "Do not repeat yourself" …
BZngr's user avatar
  • 1,217
3 votes

Excel VBA to powerpoint

Here, copying a Range from a worksheet to update a PowerPoint Slide is repeated 7 times: 'code to copy range from excel sheet Sheets("Commercial-H1").Select Sheets("Commercial-H1").Range("B3:L220").Copy … PPPres.Slides.Add(1, ppLayoutTitle) PPslide.Select PPslide.Shapes(1).TextFrame.TextRange.Text = "Monthly P&L Report" PPslide.Shapes(2).TextFrame.TextRange.Text = "Commercial" 'back to excel
BZngr's user avatar
  • 1,217
2 votes

Auto formatting and auto validating TextBox VBA

The one class is trying to handle multiple types of textboxes. In this specific case it would seem a better approach to create a class for each textbox type. This keeps code specific to each textbox …
BZngr's user avatar
  • 1,217

15 30 50 per page