LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Avoid ,,Select" and ,,Selection" in a few lines of code

Hi everybody , and have a pleasant Sunday

I have this code :

Sub macro55()

Application.ScreenUpdating = True

Dim FromWks1 As Worksheet
Dim DestWks As Worksheet
Dim NextRow As Long
Dim myCell As Range
Dim myRng1 As Range
Set FromWks1 = Workbooks("polo2x.xls").Worksheets("1")
Set DestWks = Workbooks("polo2x.xls").Worksheets("1")
With FromWks1
Set myRng1 = .Range("BA11:BA100")
End With
With DestWks
For Each myCell In myRng1.Cells
If myCell < 3 Then
myCell = myCell.Value + 1

Else: myCell.Offset(0, -4).Select
Selection.Cut
Selection.End(xlToLeft).Offset(0, 1).Select
ActiveSheet.Paste
End If
Next myCell
Application.CutCopyMode = False
Application.ScreenUpdating = True
End With
End Sub

Can it be removed the Select and Selection ?, (for speeding up
this code ) .

Thank you very much !
 
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
Range("Reset Sheet!F13").Select Makes VBA Code Fail ToferKing Excel Programming 3 July 11th 07 04:18 AM
VB Script: Code for "Sheets in selection" J@Y Excel Discussion (Misc queries) 1 February 9th 07 08:52 PM
macro stops on "selection.autofilter" line of code Rob Excel Programming 5 December 10th 05 02:50 PM
Fix Code: Select Case and "Contains" selection Bettergains Excel Programming 5 April 26th 05 02:22 AM
Using "Cells" to write "Range("A:A,H:H").Select" Trip Ives[_2_] Excel Programming 3 June 5th 04 03:13 PM


All times are GMT +1. The time now is 04:41 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"