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 70289

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

1 vote

Retrieve status for a list of FedEx tracking numbers

If Err.Number = 1004 Then Err.Clear '// Win 7 32-bit, Excel 2010 32-bit VBA 6.5 gave this error until I changed the formula to this shStatus.Range("A2").Value = "=INDEX(tbl_trackingCarton …
FreeMan's user avatar
  • 1,290
6 votes
Accepted

Look for keywords and copy to another sheet

Instead of hard coding x number of searches, add a loop (I used a While...Wend) that repeats until the user enters a blank search term. This will allow them to search for as few or as many words as t …
FreeMan's user avatar
  • 1,290
1 vote

Function for minimum non-zero with multiple additional conditions

This is a really funky way of formatting an If statement and is totally inconsistent with the rest of the procedure (and the way most people would format it): If ValOne > ValTwo _ Then Se …
FreeMan's user avatar
  • 1,290
2 votes

Excel VBA code that copies data from one sheet to another

A few items as I look through the code: Use Option Explicit. Always. Every time. Every module. No exception. When I added Option Explicit (well, OK, I have it set to always add it), your code won't …
FreeMan's user avatar
  • 1,290
3 votes

Turn On/Off Functions to speed things up

You should save the initial state of the Application.* variables before you mess with them, then reset them when you're done. Not all of your users will have the same settings and it's rude to assume …
FreeMan's user avatar
  • 1,290
1 vote
Accepted

Calculate Threaded Pipe Lengths and Component Counts to Build Plumbing System

Use Option Explicit at the top of all code modules. Without it, a typo will create a whole new variable, potentially leading to unexpected and difficult to locate bugs. SS_Con is not defined. SS_Un …
FreeMan's user avatar
  • 1,290
9 votes

VBA - Excel add in Convert number to Text currency

After a very quick glance, at an absolute minimum, you should declare a specific Type for all your parameters and variables, and ensure that they're the appropriate type. For example, CurrencyConversi …
FreeMan's user avatar
  • 1,290
6 votes
Accepted

VBA - Excel add in Convert number to Text currency

While I understand it's not generally done, I'm adding a review of the slightly updated code which should not have been posted as an answer. There seem to be sufficiently few changes made that it's no …
FreeMan's user avatar
  • 1,290
5 votes

Macro that does some kind of duplicate check

Since you indicate that this process is taking 15+ minutes, it's possible that someone may click on another Excel workbook or open a new one, and your processing will immediately start acting on whatever … workbook now has the focus in Excel. …
FreeMan's user avatar
  • 1,290
1 vote
Accepted

User form that searches a spreadsheet

Worksheet functions like CountIf are pretty well optimized, so that's a good way to find out if TXTBUSCAART.Text is in column A of your dataSheet. but so is Find. By using Find, you could eliminate …
FreeMan's user avatar
  • 1,290
8 votes
Accepted

Looks at order data and arranges it to focus on order locations

A quick fix would be to change: For Each cell In rng.Cells For Each header In rng2.Cells If cell.Value = 0 Then ElseIf cell.Value <> header.Value And s2.Cells(cell.row, header.Co …
FreeMan's user avatar
  • 1,290
1 vote
Accepted

Unoptimized VBA macro that edits cell values based on a partial string

Off the top of my head, you can eliminate all but one of the For loops. Sub Contain_Copy() Dim ranger As Long Dim lastRow As Long Dim fromSheet As Worksheet Dim toSheet As Worksheet Set fr …
FreeMan's user avatar
  • 1,290
3 votes
Accepted

Retrieving mail attachments given criteria with VBA

Turn off other screen updating things in Excel. … You're doing it 800,000 times and each time you do, Excel has to free the memory then reallocate it when you hit the next Set wb = something statement. …
FreeMan's user avatar
  • 1,290
6 votes
Accepted

Workbook _open copy-paste reference sheet (30k+lines) from other workbook on change only

I think you'd have to have a chat with MS's Excel development team to really address that. … Doesn't Excel have a nifty function to do that? Why... yes, yes it does! …
FreeMan's user avatar
  • 1,290
7 votes

VBA functions to calculate sun and moon positions

At a bare minimum declare your variable types when Dimming variables*. If you don't, they're automatically Variant. The VBA runtime must then evaluate the variable each and every time it's accessed to …
FreeMan's user avatar
  • 1,290

15 30 50 per page