LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Efficiency of Code Help

It's difficult to test without data, but here's an attempt.

Sub DataMove()
RowCount = 1
With ActiveSheet
For RowCount = 1 To .UsedRange.Rows.Count
If .Cells(RowCount, 2).Value Like "*Ask Jeeves organic*" Or _
.Cells(RowCount, 2).Value Like "*Unified Sources
(evar17)*" Or _
.Cells(RowCount, 2).Value Like "*Google organic*" Or _
.Cells(RowCount, 2).Value Like "*Microsoft Bing
organic*" Or _
.Cells(RowCount, 2).Value Like "*Live.com organic*" Or
_
.Cells(RowCount, 2).Value Like "*Yahoo! organic*" Or _
.Cells(RowCount, 2).Value Like "*AOL.com Search
organic*" Then
.Cells(RowCount, 19).Value = .Cells(RowCount, 2).Value
.Cells(RowCount, 20).Value = .Cells(RowCount, 2).Offset(0,
1).Value
.Cells(RowCount, 21).Value = .Cells(RowCount, 2).Offset(0,
2).Value
.Cells(RowCount, 22).Value = .Cells(RowCount, 2).Offset(0,
3).Value
.Cells(RowCount, 18).Value = .Cells(RowCount, 2).Offset(0,
-1).Value
End If
If .Cells(RowCount, 18).Value = (.Range("A" & Rows.Count).End
(xlUp)) - 1 Or _
.Cells(RowCount, 18).Value = "Date" Then
.Cells(RowCount, 7).Value = .Cells(RowCount, 18).Value
.Cells(RowCount, 8).Value = .Cells(RowCount, 18).Offset(0,
1).Value
.Cells(RowCount, 9).Value = .Cells(RowCount, 18).Offset(0,
2).Value
.Cells(RowCount, 10).Value = .Cells(RowCount, 18).Offset
(0, 3).Value
.Cells(RowCount, 11).Value = .Cells(RowCount, 18).Offset
(0, 4).Value
End If
Next RowCount
.Range("P1").Value = (.Range("A" & Rows.Count).End(xlUp)) - 1
.Range("R1:V500").Delete
.Range("P1:P1").Delete
.UsedRange.AutoFormat
End With
End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
efficiency Carlee Excel Programming 3 September 24th 07 09:14 AM
VBA Code Efficiency Question Johnny[_9_] Excel Programming 2 August 28th 05 09:59 AM
Efficiency in my code (a critique from the guru's) Wally Steadman[_4_] Excel Programming 1 December 30th 04 12:45 PM
VB Efficiency: Inserting a Row Tippy[_3_] Excel Programming 8 May 26th 04 08:34 PM


All times are GMT +1. The time now is 08:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"