wadirks
04-17-2006, 08:14 AM
I am unclear on the differences between select and activate in the context of worksheet or range or cell. The below code snippet uses select. Visually it is distracting to see things flash around if you are doing selects in several different places in sequence. Can I use activate and elimiate the visual effect of select? Or is there another way without select to do the same thing?
Please do concentrate on what the code does as the visual effect the code creates. I also want to apply your suggestions on other macros.
Sheets("S Rpt").Select
Range("F3").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.RowHeight = 21
'
' copy "task" column format
'
Range("H3").Select
lSRptFirstRow = Selection.Row
Selection.End(xlDown).Select
lSRptLastRow = Selection.Row
'
Range("H3").Select
Range(Selection, Cells(lSRptLastRow, Selection.Column)).Select
Application.CutCopyMode = False
Selection.Copy
Cells(3, lSRptTaskCol).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
'
' copy "call" column format
'
Range("J3").Select
Range(Selection, Cells(lSRptLastRow, Selection.Column)).Select
Application.CutCopyMode = False
Selection.Copy
Cells(3, lSRptCallCol).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
'
' copy "start" column format
'
Range("L3").Select
Range(Selection, Cells(lSRptLastRow, Selection.Column)).Select
Application.CutCopyMode = False
Selection.Copy
Cells(3, lSRptStartCol).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Please do concentrate on what the code does as the visual effect the code creates. I also want to apply your suggestions on other macros.
Sheets("S Rpt").Select
Range("F3").Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False
Selection.RowHeight = 21
'
' copy "task" column format
'
Range("H3").Select
lSRptFirstRow = Selection.Row
Selection.End(xlDown).Select
lSRptLastRow = Selection.Row
'
Range("H3").Select
Range(Selection, Cells(lSRptLastRow, Selection.Column)).Select
Application.CutCopyMode = False
Selection.Copy
Cells(3, lSRptTaskCol).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
'
' copy "call" column format
'
Range("J3").Select
Range(Selection, Cells(lSRptLastRow, Selection.Column)).Select
Application.CutCopyMode = False
Selection.Copy
Cells(3, lSRptCallCol).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
'
' copy "start" column format
'
Range("L3").Select
Range(Selection, Cells(lSRptLastRow, Selection.Column)).Select
Application.CutCopyMode = False
Selection.Copy
Cells(3, lSRptStartCol).Select
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False