Sabtu, 03 September 2011

[bulk] Re: [ExcelVBA]

 

This question is..

I have three sheets

sheet 1-REQUIRED (where I am listing all the required ID, FORMNO,+SOME
OTHER FIELDS ALSO THERE)

Sheet 2-ITPH(where I am entering ID, FORMNO+other data In other fields)

Sheet 3-OUTSTANDING(where I want to populate the data from REQUIRED
sheet which does not match the data from ITPH, comparing has to be on 2
fields ID & FORMNO both should be matched, because a particulare id is
having n number of forms)

If you want I can send the file on your personal id as I cannot post
attachement here.

Best Regards

Momin Siraj Ahmad

From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
Behalf Of David Smart
Sent: 03 September 2011 01:30 PM
To: ExcelVBA@yahoogroups.com
Subject: [bulk] Re: [ExcelVBA]
Importance: Low

I think you need to give more information ... i.e. examples including
specific values and descriptions of what it does, and what you want it
to
do.

What you have written is a test that will only be true of c.Range("A" &
itr)
<> arr(11) AND c.Range("C" & itr) <> arr(0).

Isn't this what you want?

If you want it to be true if c.Range("A" & itr) <> arr(11) OR
c.Range("C" & itr) <> arr(0), then use "or" instead of "and".

Regards, Dave S

----- Original Message -----
From: "Siraj Momin (BTG)" <smomin@ccc.ae <mailto:smomin%40ccc.ae> >
To: <ExcelVBA@yahoogroups.com <mailto:ExcelVBA%40yahoogroups.com> >
Sent: Saturday, September 03, 2011 3:30 PM
Subject: [ExcelVBA]

> Dear members
>
> I have following code it works fine but the problems in code If
> c.Range("A" & itr) <> arr(11) And c.Range("C" & itr) <> arr(0) Then it
> is fulfilling either one before And or after And I want it to fulfill
> both the condition can any body help me out....
>
>
> Sub PopulateOutstanding()
> Dim itr As Long 'row on sheet itph
> Dim rqr As Long 'row on sheet required
> Dim osr As Long 'row on sheet outstanding
> Dim arr(11) As String ' 11 element array to hold the required
> Dim c As Worksheet
> Dim i As Worksheet
> Dim r As Worksheet
> Set c = Worksheets("ITPH")
> Set i = Worksheets("REQUIRED")
> Set r = Worksheets("OUTSTANDING")
>
> 'clear required sheet
> r.Range("A2:" & r.Range("L2").End(xlDown).Address).Clear
>
> 'set up start rows
> rqr = 2
> osr = 2
>
> 'step through required
> Do While i.Range("A" & rqr) <> ""
> arr(0) = i.Range("A" & rqr)
> arr(1) = i.Range("B" & rqr)
> arr(2) = i.Range("C" & rqr)
> arr(3) = i.Range("D" & rqr)
> arr(4) = i.Range("E" & rqr)
> arr(5) = i.Range("F" & rqr)
> arr(6) = i.Range("G" & rqr)
> arr(7) = i.Range("H" & rqr)
> arr(8) = i.Range("I" & rqr)
> arr(9) = i.Range("J" & rqr)
> arr(10) = i.Range("K" & rqr)
> arr(11) = i.Range("L" & rqr)
>
> 'now loop through itph
> itr = 2
> Do While c.Range("A" & itr) <> ""
> If c.Range("A" & itr) <> arr(11) And c.Range("C" & itr) <>
> arr(0) Then
> 'arr(10) = c.Range("B" & itr)
> 'arr(11) = c.Range("C" & itr)
> r.Range("A" & osr, "L" & osr) = arr
> osr = osr + 1
> End If
> itr = itr + 1
> Loop
> rqr = rqr + 1
> Loop
> End Sub
>
>
> Best Regards
>
> Momin Siraj Ahmad
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles!
Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then
search
> the ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1392 / Virus Database: 1520/3872 - Release Date:
09/02/11
>

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE
A bad score is 579. A good idea is checking yours at freecreditscore.com.

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar