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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carrying Data From Sheet 1 to Sheet 2 only if...

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Hello all,
How can I copy contents in a ROW from sheet 1 to sheet 2 simply based on TEXT written on one of the cells in Sheet 1??? "The reward of one duty done is the power to fulfill another"
<%
Jr Clown
%>
 
ADD A MODULE TO This Workbook AND PUT THIS IN it:


Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If ActiveSheet.Name = (&quot;Sheet2&quot;) Then
GoTo endprivate
End If
omgman
endprivate:
End Sub



ADD A MODULE TO SHEET1 AND PUT THIS IN IT:

Sub omgman()

If Not ActiveSheet.Name = (&quot;Sheet1&quot;) Then
GoTo endo
End If

Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
On Error GoTo endo
a = ActiveCell.Offset(-1, 0).Value
On Error GoTo endo
aADDY = ActiveCell.Offset(-1, 0).Address
If a = &quot;good&quot; Then
Range(aADDY).EntireRow.Copy
Sheets(&quot;Sheet2&quot;).Activate
[A2].Select
ActiveSheet.Paste
Sheets(&quot;Sheet1&quot;).Activate
Range(aADDY).Select
End If

endo:
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub


-----------------------
when you enter the word &quot;good&quot; in any cell on sheet1 it will paste it into sheet2

There are many different and BETTER ways to more accuratly and dynamicly accomplish this so if you really want them email me all your info and I'll upgrade it.

Ratman drat@mediaone.net
 
Thanks for the feedback ratman. I will try it and let you know. thanks &quot;The reward of one duty done is the power to fulfill another&quot;
<%
Jr Clown
%>
 
ratman, it is not working.
Can I email you a copy of my workbook to better show you what I'm trying to do?? I would appreciate your help. &quot;The reward of one duty done is the power to fulfill another&quot;
<%
Jr Clown
%>
 
. &quot;The reward of one duty done is the power to fulfill another&quot;
<%
Jr_Clown@Yahoo.com
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top