Need some help with the code.

akashawalker

New Member
Joined
May 2, 2013
Messages
16
Hi to all
I have a code where a cell has a value it should point for a path and if have another value it should point to another path.
what i can see is that the code i have it doesn't work.

Code:
########## Flow curve folder path Pressure 'Get the model so we can select the flow curve folder for ECO and VOC
 On Error GoTo errormessage1:
  
 Dim modelcode1 As String, FCP_1 As String, FCV_1 As String, FCGF_1 As String
 Dim modelcode2 As String, FCP_2 As String, FCV_2 As String, FCGF_2 As String
 Dim modelcode3 As String, FCP_3 As String, FCV_3 As String, FCGF_3 As String
  
 'Dim FCP_1 As String, FCV_1 As String, FCGF_1 As String
 'Dim FCP_2 As String, FCV_2 As String, FCGF_2 As String
 'Dim FCP_3 As String, FCV_3 As String, FCGF_3 As String
  
 Dim Pflowcurve1 As String, Pflowcurve2 As String, Pflowcurve3 As String
 Dim Vflowcurve1 As String, Vflowcurve2 As String, Vflowcurve3 As String
 Dim GFflowcurve1 As String, GFflowcurve2 As String, GFflowcurve3 As String
  
  
     modelcode1 = Left(Worksheets("wizard setup").Range("p16").Value, 1)
 '    Worksheets("Approval Drawing 1").Range("B37").Value = modelcode1
 '
     modelcode2 = Left(Worksheets("wizard setup").Range("s16").Value, 1)
 '    Worksheets("Approval Drawing 2").Range("B37").Value = modelcode2
 '
     modelcode3 = Left(Worksheets("wizard setup").Range("v16").Value, 1)
 '    Worksheets("Approval Drawing 3").Range("B37").Value = modelcode3
 '
 '
          If modelcode1 = 3 Then
                 myDirFlow1 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1112 - PV-ECO"
            Else: modelcode1 = 4
                 myDirFlow1 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1113 - PV-VOC"
         End If
  
          If modelcode2 = 3 Then
                 myDirFlow2 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1112 - PV-ECO"
             Else: modelcode2 = 4
                 myDirFlow2 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1113 - PV-VOC"
         End If
         
          If modelcode3 = 3 Then
                 myDirFlow3 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1112 - PV-ECO"
            Else: modelcode3 = 4
                 myDirFlow3 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1113 - PV-VOC"
         End If
  
  
   If modelcode1 = 4 Then
                 myDirFlow1 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1112 - PV-ECO"
            Else: modelcode1 = 3
                 myDirFlow1 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1113 - PV-VOC"
         End If
  
          If modelcode2 = 3 Then
                 myDirFlow2 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1112 - PV-ECO"
             Else: modelcode2 = 4
                 myDirFlow2 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1113 - PV-VOC"
         End If
         
          If modelcode3 = 3 Then
                 myDirFlow3 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1112 - PV-ECO"
            Else: modelcode3 = 4
                 myDirFlow3 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1113 - PV-VOC"
         End If
 '  If Worksheets("Approval Drawing 1").Range("b37") = 4 Then
 '       myDirFlow1 = "S:\Sales E Files\E-files\3.  Valves\Flowkurver\1113 - PV-ECO"
 ''       Else
 ''       myDirFlow1 = "S:\Sales E Files\E-files\3. Valves\Flowkurver\1112 - PV-VOC"
 '       End If

I can only see one path showing when the number is 3, but when is 4 nothing happens.

Thansk for your time and collaboration.

Sofia Grave
 
Last edited by a moderator:

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,214,911
Messages
6,122,192
Members
449,072
Latest member
DW Draft

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