Search Results
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 |
Microsoft Excel is a commercial spreadsheet application written and distributed by Microsoft.
6
votes
Spreadsheet Manipulations in Single Procedure
First, you should give your variables names that are descriptive -
Option Explicit
Sub Previous_comments_and_modifications()
Dim MainWB As Workbook
Set MainWB = ActiveWorkbook
Dim SapDataWS As Works …
1
vote
Accepted
Maintaining row height while inserting
I'm not sure what's happening on yours but with 10K rows it's doing 1 row per .000090625 seconds (<1 second total) -
Sub test()
Application.ScreenUpdating = False
Dim i As Integer
Dim firstrow As Int …
3
votes
Accepted
Calculate Maximum Time Difference Within a Time Period with Max 30 Minutes Difference
The first thing I'd say is your variable names could be improved -
what is t? BeginningTicketCount?
what is tt? EndingTicketCount?
Index and Index2 - I'd avoid Index as system reserved and I'd avoid …
3
votes
Function to return a legal name for an Excel range: Follow-up
Using Verify might confused the reader as being an excel method or function.
And if I understand correctly MakeUnique will make name if used, into name1? … If you need to explain it, explain why you're doing it this way rather than that way:
'Make sure the name is <= 255 characters could be 'Excel doesn't allow names longer than 255 characters
By the way …
0
votes
Transforming and quantizing some numbers in a spreadsheet
All right, I have some input here. First - your variables. I can't tell what they are for. I'd use
Main
Dim myWorkbook As Workbook
Set myWorkbook = ThisWorkbook
Dim cartWorksheet As Work …
1
vote
Find Duplicate with 2 criteria
I'm going to throw an answer out here as well. First things first, I agree with Mat's Mug about using codenames, but I'm going to leave it as is for my answer, out of simplicity. Same goes for indenta …
3
votes
Accepted
Toggle button that will hide/unhide columns within a range
You use ActiveWorkbook.Sheets("Notes") 5 times, throw that into a variable or use CodeName property - View Properties window (F4) and the (Name) field can be used as the worksheet name. This way you c …
3
votes
Accepted
(^|)(Get|Total|Aggregated|Summary|Data|Report) - #NamingIsHard
Is the naming too repetitive? Let's take a look at your variables
Dim aggregatedSubsheetDataReport As CLS_Data_Report
Dim clientInvestmentReport As CLS_Data_Report
Dim commissionReport As CLS_Data_Re …
1
vote
Accepted
Excel VBA to create a visual timeline of events using an XY scatter chart
There's a good question on StackOverflow addressing this - https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros . …
4
votes
Re-arranging an matrix of numbers to a numeric list
There's a good question on StackOverflow addressing this - https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros .
lastRow = Range("A1").End(xlDown).Row this isn't … a great way to do this, the standard way is lastRow = Cells(Rows.Count, 1).End(xlUp).Row - see this answer on SO by a very talented excel MVP
Everything you're doing on the sheet can be done in the code …
1
vote
Transfer the cell formatting in a legend to a dataset in another sheet
Your naming isn't great, you should use variable names to describe what they do
Dim i As Integer
Dim j As Integer
Dim mapToFill As Range
Dim legend As Range
Dim targetDestination As Range
Dim target …
4
votes
Accepted
Rearrange data without using Cut and Insert
To speed it up, I would read it into arrays. One array for column A and one array for column B and then combine them into another array and print that to sheet
Option Explicit
Sub Rearrange()
Dim …
3
votes
Accepted
Code to copy, paste and summarize a data set
There's a good question on StackOverflow addressing this - https://stackoverflow.com/questions/10714251/how-to-avoid-using-select-in-excel-vba-macros. …
3
votes
Accepted
Consolidate used student hours into master sheet for export
I'm going to address your use of constants - I don't think they are helping you very much. Most of them are just constant numbers, yes, but when I go to any of your private subs - I have no idea what …
7
votes
Accepted
Spreadsheet to calculate how to cut pipes
You didn't declare y or x.
Always turn on Option Explicit. You can have it automatically by going to Tools -> Options in the VBE and checking the Require Variable Declaration option. This way if you …