Excel Macro how to transition between to DIM statements

I have a macro that 2 nice guys on this forum just helped me with.  Now that they helped with one line section I'm trying to join another into one macro process.  I have tried all sorts of transitions.  End, End if, with.  Next... I can't seem to find what will make these work back to back.  Any help will be appreciated

Dim lrow As Long
    lrow = Cells(Cells.Rows.Count, "E").End(xlUp).Row
     Range("N2:N" & lrow).Formula = "=IF(OR(E2=""BWS"",F2=""BWS""),K2*0.5,0)"

?????what transition should I have here???????

Dim lrow As Long
    lrow = Cells(Cells.Rows.Count, "E").End(xlUp).Row
     Range("O2:O" & lrow).Formula = "=IF(OR(G2=""BWS"",H2=""BWS""),K2*0.5,0)"
jenitAsked:
Who is Participating?
 
Saurabh Singh TeotiaCommented:
You can simply do this...

Dim lrow As Long
    lrow = Cells(Cells.Rows.Count, "E").End(xlUp).Row
     Range("N2:N" & lrow).Formula = "=IF(OR(E2=""BWS"",F2=""BWS""),K2*0.5,0)"
     Range("O2:O" & lrow).Formula = "=IF(OR(G2=""BWS"",H2=""BWS""),K2*0.5,0)"

Open in new window


Saurabh...
0
 
jenitAuthor Commented:
You are a rock star!  Sometimes I over think the situation.  You guys today are a prime example of "keeping it simple"  I LIKE IT!

Worked perfect.  Duh on my part and THANKS to you!
0
 
Saurabh Singh TeotiaCommented:
You are very welcome..And Glad it help.. :-)

Ps. It's not you at times when we working on engrossed in something way too much simple things look complex.. i have done it multiple times myself.. :-)
0
 
jenitAuthor Commented:
Thanks for the kind words.  You are correct - in too deep.   Thanks for taking the time.  Have a good day!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.