Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: VBA Code to go back to the source sheet after copy a range

Status
Not open for further replies.

xitu

Technical User
Oct 1, 2003
55
US
I have the following code:

After copy a range from the original sheet to sheet "Data", how do I go back to the original sheet?



Sub CopyPressure()
Dim Fcell As String

If ActiveSheet.Name = ("Data") Then
MsgBox ("Go to the original sheet to select the first cell contained value in column Pressure")
Else
Fcell = InputBox("Type first cell in column ? Ex: B3", "Input required")
Range(Fcell).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy

Sheets("Data").Select
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
End If

End Sub


Please help.
Thanks,
XT
 
I got it. Thanks anyway

ActiveSheet.Next.Select
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top