Hello,
I am very very new to VBA, and hoping I can get some help. I have a worksheet that has the below two columns beginning at cells G:5 and H:5. I am needing to update column H based on values from G but getting stuck.
Column G Column H
I have built this with the values I ultimately need but nothing happens upon running. I would ultimately like to do this for the whole column range of G and H as the column is filtered before I need to run the macro. Any help or guidance would be appreciated.
Sub totn()
Dim ProductSF As String
Dim ProductNew As String
ProductSF = Range("G5").Value
If ProductSF = "Deposit" Then
ProductNew = "Deposit"
ElseIf ProductSF = "Card" Then
ProductNew = "Card"
ElseIf ProductSF = "CL" Then
ProductNew = "CL"
ElseIf ProductSF = "RE" Then
ProductNew = "RE"
ElseIf ProductSF = "Bank Op" Then
ProductNew = "F&C"
ElseIf ProductSF = "MDS" Then
ProductNew = "Credit Op"
ElseIf ProductSF = "MM" Then
ProductNew = "Deposit"
ElseIf ProductSF = " " Then
ProductNew = "Bankwide"
End If
Range("H5").Value = ProductNew
End Sub
I am very very new to VBA, and hoping I can get some help. I have a worksheet that has the below two columns beginning at cells G:5 and H:5. I am needing to update column H based on values from G but getting stuck.
Column G Column H
Product (SF) | Product (New Logic) |
Deposit | |
Deposit | |
Deposit | |
Deposit | |
Pay | |
Pay | |
Card | |
Pay | |
Card | |
Pay | |
Card |
I have built this with the values I ultimately need but nothing happens upon running. I would ultimately like to do this for the whole column range of G and H as the column is filtered before I need to run the macro. Any help or guidance would be appreciated.
Sub totn()
Dim ProductSF As String
Dim ProductNew As String
ProductSF = Range("G5").Value
If ProductSF = "Deposit" Then
ProductNew = "Deposit"
ElseIf ProductSF = "Card" Then
ProductNew = "Card"
ElseIf ProductSF = "CL" Then
ProductNew = "CL"
ElseIf ProductSF = "RE" Then
ProductNew = "RE"
ElseIf ProductSF = "Bank Op" Then
ProductNew = "F&C"
ElseIf ProductSF = "MDS" Then
ProductNew = "Credit Op"
ElseIf ProductSF = "MM" Then
ProductNew = "Deposit"
ElseIf ProductSF = " " Then
ProductNew = "Bankwide"
End If
Range("H5").Value = ProductNew
End Sub