Select Case Join Application.Transpose range change

Edgarvelez

Board Regular
Joined
Jun 6, 2019
Messages
197
Office Version
  1. 2016
Platform
  1. Windows
Hi All,
Was given a code and has worked really good, however I had to make a change (Added a row in sht1) and my range is not longer ("D9:D13") and now it's now ("D9") and ("D11:D13")
Need some help fixing this line, tried a few thing but I get errors and its above my knowledge grade, any help is appreciated and thanks.

VBA Code:
    sh1.Select
    Select Case Join(Application.Transpose(sh1.Range("D9:D13").Value), "|")
    
    Case "Metric Ton|GW|Single Line|Single Line Weight"
    sh1.Range("D32").Select
    ActiveCell.FormulaR1C1 = "=ROUND((R[-6]C/R[-8]C),3)"
    sh1.Range("D33").Select
    ActiveCell.FormulaR1C1 = "=ROUND((R[-6]C/R[-9]C),3)"
    sh1.Range("A1").Select
    'GW
    sh1.Range("D26").Copy
    sh2.Cells(Rows.Count, 8).End(xlUp)(2).Resize(sh1.Range("D30").Value).PasteSpecial xlPasteValues
    Application.CutCopyMode = False
    sh1.Range("D30:D33").Select
    Selection.ClearContents
    sh1.Range("A1")
 
Sorry no meant what i gave apparently caused a compile error. It doesnt if applied correctly so i was trying to establish why.
 
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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