dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,392
- Office Version
- 365
- 2016
- Platform
- Windows
I have some code that is meant to copy rows in a spreadsheet depending on the value of the cell in column F for that row. I need to be able to distinguish between having the value to be Ang Wes or Ang Riv. At the moment, regardless of the value, it will always default to Ang Riv but I need DocYearName to be the value in column 36 if Ang Wes is entered in column 6.
I think I need a select case statement or something similar but I am not sure of the code. Can someone help me please?
I think I need a select case statement or something similar but I am not sure of the code. Can someone help me please?
Code:
If tblrow.Range.Cells(1, 6).Value = "Ang Wes" Then
DocYearName = tblrow.Range.Cells(1, 37).Value
Else
DocYearName = tblrow.Range.Cells(1, 36).Value
End If
If tblrow.Range.Cells(1, 6).Value = "Ang Riv" Then
DocYearName = tblrow.Range.Cells(1, 37).Value
Else
DocYearName = tblrow.Range.Cells(1, 36).Value
End If