multiple conditioning macro

beczer

New Member
Joined
Nov 21, 2016
Messages
49
Hi

I need your help. I have a problem with multiple conditioning in VBA

Code:
If LCase(Trim(.Cells(lRow, "P"))) = "0" & LCase(Trim(.Cells(lRow, "N"))) = "Name" & LCase(Trim(.Cells(lRow, "O"))) = "Language" Then FPATH = Sheet3.[l5]        If LCase(Trim(.Cells(lRow, "P"))) = "1" & LCase(Trim(.Cells(lRow, "N"))) = "Name" & LCase(Trim(.Cells(lRow, "O"))) = "Language" Then FPATH = Sheet3.[l6]
        If LCase(Trim(.Cells(lRow, "P"))) = "0" & LCase(Trim(.Cells(lRow, "N"))) = "Name2" & LCase(Trim(.Cells(lRow, "O"))) = "Language" Then FPATH = Sheet3.[l7]
        If LCase(Trim(.Cells(lRow, "P"))) = "1" & LCase(Trim(.Cells(lRow, "N"))) = "Name2" & LCase(Trim(.Cells(lRow, "O"))) = "Language" Then FPATH = Sheet3.[l8]
  
        If LCase(Trim(.Cells(lRow, "P"))) = "0" & LCase(Trim(.Cells(lRow, "N"))) = "Name" & LCase(Trim(.Cells(lRow, "O"))) = "Language2" Then FPATH = Sheet3.[l9]
        If LCase(Trim(.Cells(lRow, "P"))) = "1" & LCase(Trim(.Cells(lRow, "N"))) = "Name" & LCase(Trim(.Cells(lRow, "O"))) = "Language2" Then FPATH = Sheet3.[l10]
        If LCase(Trim(.Cells(lRow, "P"))) = "0" & LCase(Trim(.Cells(lRow, "N"))) = "Name2" & LCase(Trim(.Cells(lRow, "O"))) = "Language2" Then FPATH = Sheet3.[l11]
        If LCase(Trim(.Cells(lRow, "P"))) = "1" & LCase(Trim(.Cells(lRow, "N"))) = "Name2" & LCase(Trim(.Cells(lRow, "O"))) = "Language2" Then FPATH = Sheet3.[l12] 
	Else FPATH = Sheet3.[l5]

It doesn't work. Above code take (process) only first row.

Thank you in advance for your support
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
LCase() = "Name" and LCase() = "Language" will NEVER be true because LCase takes a lower case version. The code is not particularly efficient but at the very least you need to use "name", "name2", "language" and "language2".

WBND
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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