2 Worksheets and Yes answer

sh3rvin

New Member
Joined
Feb 13, 2014
Messages
5
So I have 2 worksheets.

Sheet 1 contains 425 rows and the last column being used is O currently. The first column contains a unique identifier number.
Sheet 2 is used to send out mail merges it contains less rows until it is filled and the last column being used is S currently.

Now in Sheet1, in column O I will be entering the answer "yes" to indicate we have had a response with our mail merge. How do have this answer appear in Sheet2 in Column R using the first column on both sheets which is a unique identifier number?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi sh3rvin,

Put the following in cell R2 (assuming this is the starting Row - change the following to suit) and copy down as far as required:

=VLOOKUP(A2,Sheet1!A:O,15,FALSE)

Regards,

Robert
 
Upvote 0
Try this:
This script will run when you enter the value "Yes" into Column(O) on Sheet(1)

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet(1) tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  6/20/2019  7:48:44 PM  EDT
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column = 15 Then
Dim ans As Long
Dim m As Long
If Target.Value = "Yes" Then
ans = Target.Row
m = Cells(ans, 1).Value
Dim SearchString As String
Dim SearchRange As Range
SearchString = m
Dim lastrow As Long
lastrow = Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row
Set SearchRange = Sheets(2).Range("A1:A" & lastrow).Find(SearchString, LookIn:=xlValues, lookat:=xlWhole)
If SearchRange Is Nothing Then MsgBox SearchString & "  Not Found": Exit Sub
SearchRange.Offset(0, 17).Value = "Yes"
End If
End If
End Sub
 
Upvote 0
Hi sh3rvin,

Put the following in cell R2 (assuming this is the starting Row - change the following to suit) and copy down as far as required:

=VLOOKUP(A2,Sheet1!A:O,15,FALSE)

Regards,

Robert

Thank you Robert, this has worked. Apologies for replying back now.
 
Upvote 0
Try this:
This script will run when you enter the value "Yes" into Column(O) on Sheet(1)

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet(1) tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  6/20/2019  7:48:44 PM  EDT
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column = 15 Then
Dim ans As Long
Dim m As Long
If Target.Value = "Yes" Then
ans = Target.Row
m = Cells(ans, 1).Value
Dim SearchString As String
Dim SearchRange As Range
SearchString = m
Dim lastrow As Long
lastrow = Sheets(2).Cells(Rows.Count, "A").End(xlUp).Row
Set SearchRange = Sheets(2).Range("A1:A" & lastrow).Find(SearchString, LookIn:=xlValues, lookat:=xlWhole)
If SearchRange Is Nothing Then MsgBox SearchString & "  Not Found": Exit Sub
SearchRange.Offset(0, 17).Value = "Yes"
End If
End If
End Sub

I could try this but for a different purpose. In the other tab, when I enter the filename of a letter I sent out, I then have to update the main sheet to "Yes" for letter sent out. Could something similar to this work? The problem is the filename will be unique for a batch of letters and starts with 00x -
 
Upvote 0

Forum statistics

Threads
1,223,975
Messages
6,175,742
Members
452,667
Latest member
vanessavalentino83

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top