VB Script help

tg2006

New Member
Joined
Mar 26, 2006
Messages
13
I'm looking for an easy way to build column L from Column M. Example - Column M has a weight of 5 pounds. I need to insert into column L the same row a price of $6.64. I need this tool to look at all the rows in colymn M and insert a corresponding price in column L.

Column M Column L
<=5 pounds $6.64
<=10 pounds $8.74
<=15 pounds $12.07

Thanks for your help - Ken
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Can you modify this to fit your needs?
Code:
Sub Case_Select()
Dim Tcell As Range

For Each Tcell In Range("M:M")
        Select Case Tcell.Value
            Case "Whatever 1"
                Tcell.Offset(0, -1).Value = "Whatever x"
             Case "Whatever 2"
                Tcell.Offset(0, -1).Value = "Whatever y"
            Case "Whatever 3"
                Tcell.Offset(0, -1).Value = "Whatever z"
        End Select
Next Tcell
               
End Sub

If not, post back with a little more information (What value matches what value).

Mac
 
Upvote 0
Hi

How about

Code:
Range("m4").Formula = "=IF(L4<=5,6.64,IF(L4<=10,8.74,12.07))"
Range("M4").AutoFill Destination:=Range("M4:M" & Cells(Rows.Count, "L").End(xlUp).Row)
With Range("M4:M" & Cells(Rows.Count, "M").End(xlUp).Row)
 .Value = .Value
End With

Tony
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,546
Members
449,038
Latest member
Guest1337

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