VBA Coding Required to populate value based on another cell value

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
Hope you can help.

I have extracted the below code from a Macro in an old workbook, but need to adapt it to another sheet

In my new sheet I am populating data in D24.

In D25, I want it to auto populate a tier the work is categorised into


Below is an extract, hopefully this will be enough to give you the idea of what I need (In the original sheet there was a Column Header called "Changes Requested", but I cannot work out how to adapt to look at a particular cell, rather than that column header, then the details in that row.

VBA Code:
If varChangesRequested Like "*ssignment*" Then
                                currTier = 3
                            ElseIf varChangesRequested Like "*ttribute removal*" Or _
                                varChangesRequested Like "*LOV value removal*"  Then
                                
                                currTier = 2
                                'Business rule changes
                                ElseIf varChangesRequested Like "*Business rule changes*" Then
                                If dChangesRequested.Item(varChangesRequested) > 30 Then
                                    currTier = 2
                                Else
                                    currTier = 1
                                    End If
 Next
                        
                        
                        'update the field on the tracker
                        Select Case maxTier
                            Case 0
                                ThisWorksheet.Cells(CurrentCell.Row, FindColumn(ThisWorksheet, "Tier").Column).Value = "Unable to calculate Tier"
                            Case 1
                                ThisWorksheet.Cells(CurrentCell.Row, FindColumn(ThisWorksheet, "Tier").Column).Value = "Tier 1"
                            Case 2
                                ThisWorksheet.Cells(CurrentCell.Row, FindColumn(ThisWorksheet, "Tier").Column).Value = "Tier 2"
                            Case 3
                                ThisWorksheet.Cells(CurrentCell.Row, FindColumn(ThisWorksheet, "Tier").Column).Value = "Tier 3"
                                
                        End Select
                    End If

So, if the value was 20x Attribute removal in D24, then in D25 I want it to Say
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,214,915
Messages
6,122,214
Members
449,074
Latest member
cancansova

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