C
carruthers
Hi,
First time & new to excel macros. I have a macro which copies data &
inserts it into a viewable summary sheet which can be printed. The
range is 6 cells & if cell k7 is selected I want to stop the macro. I
have attempted to use IF command with Then End but it ignores it. Here
is my macro:
' refence point to start pasting sequence
Sheets("Alfa data").Select
Range("C225").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet4").Select
Range("c7").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Select
If ActiveCell.Address = "K7" Then End 'This is my problem area,
I want it to stop here.
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Alfa Data").Select
Range("C226").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet4").Select
Range("c7").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(2, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
Application.CutCopyMode = False
Range("A1").Select
First time & new to excel macros. I have a macro which copies data &
inserts it into a viewable summary sheet which can be printed. The
range is 6 cells & if cell k7 is selected I want to stop the macro. I
have attempted to use IF command with Then End but it ignores it. Here
is my macro:
' refence point to start pasting sequence
Sheets("Alfa data").Select
Range("C225").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet4").Select
Range("c7").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(0, 1).Select
If ActiveCell.Address = "K7" Then End 'This is my problem area,
I want it to stop here.
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Sheets("Alfa Data").Select
Range("C226").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet4").Select
Range("c7").Select
Selection.End(xlToRight).Select
ActiveCell.Offset(2, 0).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.ScreenUpdating = True
Application.CutCopyMode = False
Range("A1").Select