Re: Enlighten me - Mac vs. PC processing speeds
- From: c1802362@xxxxxxx
- Date: Tue, 26 Feb 2008 18:37:21 -0800 (PST)
On Feb 26, 8:00 am, Bob Greenblatt <b...@xxxxxxxxxx> wrote:
Without looking at your code, it's pretty hard to tell, but here are a few
things:
- 1. it's just slower on a Mac. (how much slower, depends on what you are
doing.)
- 2. displayupdating=false isn't quite the same thing on the Mac as windows,
the Mac display is still repainted under certain conditions.
- 3. on either platform, NEVER activate, and/or select items, ranges, etc.
It REALLY REALLY slows things down.
--
Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom
I probably broke the do not select rule, but if you can give me any
guidance it would be greatly appreciated:
first the code
**************************
Sub SelectDown()
Dim count As Integer, pointer As Integer, num As Integer
Dim lastrow As Long
count = 1 'sets the destination row location
pointer = 3 'locates the source data location's start
' find the last row in the file
lastrow = Range("b65536").End(xlUp).Row
Range("A1").Select
Application.ScreenUpdating = False
Do Until pointer > lastrow
' find the start of the next data record
Cells.Find(What:="STCNumber", After:=ActiveCell, _
SearchOrder:=xlByRows, SearchDirection:=xlNext).Activate
' move over one column to data
ActiveCell.Offset(0, 1).Range("a1").Select
' select this data to the end of the record
Range(ActiveCell, ActiveCell.End(xlDown)).Select
Selection.Copy
' count the number of cells in this record
selRange = Range(ActiveCell,
ActiveCell.End(xlDown)).Address(rowabsolute:=True,
columnabsolute:=True)
num = Range(selRange).count
'transpose and paste the selected record a few columns over
Cells(count, 3).PasteSpecial Transpose:=True
'advance the row pointer
count = count + 1
' advance the source data cell pointer
pointer = pointer + num
' go to the next data record
Cells(pointer, 1).Select
pointer = pointer + 1
Loop
Application.ScreenUpdating = True
'add a new *** and place the data from the source *** on it
ActiveCell.Cells.Select
Cells.Select
Selection.Copy
Sheets.Add
Range("A1").Select
Active***.Paste
'delete the first two columns (original data)
ActiveCell.Columns("A:B").EntireColumn.Select
ActiveCell.Offset(0, 1).Range("A1").Activate
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
ActiveCell.Offset(0, -1).Columns("A:H").EntireColumn.Select
Selection.ColumnWidth = 27.71
Range("A1").Select
End Sub
here's what a typical data record looks like:
*************************************
Number SA00029WI
Manufacturer Acme
MakeModel 180
TCNumber 5A63467
Description uprated model
Status Issued 2/11/93
ACO CE-W
Holder Acme Products
P.O. Box 357
Wellington KANSAS 67152 UNITED STATES
.
- Follow-Ups:
- Re: Enlighten me - Mac vs. PC processing speeds
- From: Bob Greenblatt
- Re: Enlighten me - Mac vs. PC processing speeds
- References:
- Enlighten me - Mac vs. PC processing speeds
- From: c1802362
- Re: Enlighten me - Mac vs. PC processing speeds
- From: Jim Gordon MVP
- Re: Enlighten me - Mac vs. PC processing speeds
- From: c1802362
- Re: Enlighten me - Mac vs. PC processing speeds
- From: Bob Greenblatt
- Enlighten me - Mac vs. PC processing speeds
- Prev by Date: Re: Page break preview in Excel 2008
- Next by Date: Re: Page break preview in Excel 2008
- Previous by thread: Re: Enlighten me - Mac vs. PC processing speeds
- Next by thread: Re: Enlighten me - Mac vs. PC processing speeds
- Index(es):