IF “text” matches COPY ONE CELL TO ANOTHER, IF NO “0” AMOUNT

MOwensAZFP

New Member
Joined
Jun 21, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
In Cell A1 had drop down box with the following

“Alpha” verbiage
“Bravo” verbiage
“Charlie” verbiage
“Delt” verbiage
“Fox” verbiage

In Cell B2 I have a dollar amount $ 100.00 need to copy to cell B3
if text is"
“Bravo” verbiage
“Charlie” verbiage
“Delt” verbiage

if text is:
“Alpha” verbiage
“Fox” verbiage
Then Cell B3 is to be blank (no dollar amount or text)


1718990209007.png


thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Please put the following formula in B3

Please ensure the text appearing in A1 is put inside quotes,
eg: if the text is Alpha verbiage, please put "Alpha verbiage"
if it is "Alpha" verbiage, please put """Alpha"" verbiage" (please look at the three double quotes before and the two double quotes after Apha)

=IF(OR(A1="""Bravo"" Verbiage",A1="""Charlie"" Verbiage",A1="""Delt"" Verbiage"),B2,IF(OR(A1="""Alpha"" Verbiage",A1="""Fox"" Verbiage"),0,"no selection"))
 
Upvote 0
Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Make a selection in A1.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
    Application.ScreenUpdating = False
    Select Case Target.Value
        Case "Bravo", "Charlie", "Delt"
            If Target.Offset(1, 1) = 100 Then
                Target.Offset(2, 1) = 100
            End If
        Case "Alpha", "Fox"
            Target.Offset(2, 1).ClearContents
    End Select
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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