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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Macropheliac

Board Regular
Joined
Aug 26, 2005
Messages
165
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
 

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
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
 

Forum statistics

Threads
1,136,519
Messages
5,676,333
Members
419,619
Latest member
jalme

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
Top