Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 171
Default code line with two conditions

I am not an expert in Vba code.I have a line code
If cell.offset(0,2).value< _
Worksheets(cell.value).Range("A1").End(xlDown) Then
Set Sh1=nothing
I would like to add one more condition to the above line,apart from the
above condition, If cell.offset(0,1) .value= "EQ" or "BE".How to modify my
line code ?
If my coditions are not met ,the sub should exit by prompting message
"Conditions are not met,Updation not required" with one "ok" button.Where
this message code line has to incorporate.Thanks whole community in advance.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default code line with two conditions

I coded exactly what yuo asked for. Can't guarentee it will work.

If (cell.offset(0,2).value< Worksheets(cell.value).Range("A1").End(xlDown)
_
or (cell.offset(0,1) .value= "EQ") _
or (cell.offset(0,1) .value= "BE") Then

"TUNGANA KURMA RAJU" wrote:

I am not an expert in Vba code.I have a line code
If cell.offset(0,2).value< _
Worksheets(cell.value).Range("A1").End(xlDown) Then
Set Sh1=nothing
I would like to add one more condition to the above line,apart from the
above condition, If cell.offset(0,1) .value= "EQ" or "BE".How to modify my
line code ?
If my coditions are not met ,the sub should exit by prompting message
"Conditions are not met,Updation not required" with one "ok" button.Where
this message code line has to incorporate.Thanks whole community in advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 171
Default code line with two conditions

This gives if any one condition is true,Then ...the asked results will
come.My question is If first condition and any one of second and third
condition is true,then....so. Can it be used with "and" and "or".
What about my 2nd part of my question?.

"Joel" wrote:

I coded exactly what yuo asked for. Can't guarentee it will work.

If (cell.offset(0,2).value< Worksheets(cell.value).Range("A1").End(xlDown)
_
or (cell.offset(0,1) .value= "EQ") _
or (cell.offset(0,1) .value= "BE") Then

"TUNGANA KURMA RAJU" wrote:

I am not an expert in Vba code.I have a line code
If cell.offset(0,2).value< _
Worksheets(cell.value).Range("A1").End(xlDown) Then
Set Sh1=nothing
I would like to add one more condition to the above line,apart from the
above condition, If cell.offset(0,1) .value= "EQ" or "BE".How to modify my
line code ?
If my coditions are not met ,the sub should exit by prompting message
"Conditions are not met,Updation not required" with one "ok" button.Where
this message code line has to incorporate.Thanks whole community in advance.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default code line with two conditions

If (cell.offset(0,2).value< Worksheets(cell.value).Range("A1").End(xlDown)
_
or (cell.offset(0,1) .value= "EQ") _
or (cell.offset(0,1) .value= "BE") Then

'your code

else

msgbox("Conditions are not met,Updation not required")
exit sub

end if


"TUNGANA KURMA RAJU" wrote:

This gives if any one condition is true,Then ...the asked results will
come.My question is If first condition and any one of second and third
condition is true,then....so. Can it be used with "and" and "or".
What about my 2nd part of my question?.

"Joel" wrote:

I coded exactly what yuo asked for. Can't guarentee it will work.

If (cell.offset(0,2).value< Worksheets(cell.value).Range("A1").End(xlDown)
_
or (cell.offset(0,1) .value= "EQ") _
or (cell.offset(0,1) .value= "BE") Then

"TUNGANA KURMA RAJU" wrote:

I am not an expert in Vba code.I have a line code
If cell.offset(0,2).value< _
Worksheets(cell.value).Range("A1").End(xlDown) Then
Set Sh1=nothing
I would like to add one more condition to the above line,apart from the
above condition, If cell.offset(0,1) .value= "EQ" or "BE".How to modify my
line code ?
If my coditions are not met ,the sub should exit by prompting message
"Conditions are not met,Updation not required" with one "ok" button.Where
this message code line has to incorporate.Thanks whole community in advance.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
line code modification TUNGANA KURMA RAJU Excel Discussion (Misc queries) 3 March 2nd 07 01:12 PM
Looking for code to separate one line of text into multiple lines in Excel [email protected] Excel Worksheet Functions 1 February 13th 07 12:59 AM
how do you execute single line of code? honestlylion Excel Discussion (Misc queries) 2 February 24th 06 03:35 PM
VB Code and Sum with Two Conditions Gos-C Excel Worksheet Functions 0 February 14th 06 03:10 AM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


All times are GMT +1. The time now is 05:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"