Skip,
I read the last post before I read yours. I sencerely thank you all the time and effort you put into helping me. I apologuize if I abused your genererous sharing of your knowledge.
Once again thanks.
I was unaware that I had violated this forum's code of behavior. I though that Skip and I were involved in one entended conversation. Where I come from you thank people at the end of a conversation or when an issues is resolved not after each sentence.
Skip,
The program runs until it gets to about line 5700+ then it gets into some sort of loop going down to row 6800+ then back upto 5700+. It cycles through the loop 3 or 4 times and then my notebook crashes.
I am looking at the data in the region where the fatal loop starts and ends to see...
The value in cell B4 on wsFirst QT is A100. The value in cell B2 on wsPrepared_Expense is A100.
I have created awork book with a wsQT and a wsPE with enough real data to test all the things the program should.
Would you like it? If so how do I get it to you?
My email address is...
I get a type mismatch error at;
Do While (.Offset(r, 0).Value = rngGMPCA.Value)
The Loop is iterating through DAFRPCAs as long as the DAFRPCA equals the GMPCA. Is it necessary to tell the program that's dealing with rngDAFRPCA somewhere before the loop?
When the Loop ends does the program get...
This is what the code looks like.
It is still adding a row with each increment of the Do Loop at the end of the records on PE and no data is being transfered from QT to PE.
Sub PCA()
Dim wsPE As Worksheet, wsQT As Worksheet
Set wsPE = Sheets("Prepared_Expense")
Set wsQT = Sheets("First QT")...
Skip,
I will make to code changes on the train and will get back to you when I get home. I have to go to catch my train. I stayed late yesterday and caught the last one but I can't do that today
How would you determine what the "ENTIRE USED RANGE on the PE Sheet" is?
In my orginal code I initialized variables outside the loop. With the following code;
'This initializes the variable for the first match.
Set rngDAFRPCA = Sheets("Prepared_Expense").Range("Q2").Offset(1, -15) 'Range _...
The first rngCopy should be CB4:CE4 on QT. The code is getting rngGMPCA from B4 on QT as it should.
Does the following statement say do something at R13708 not R2 where it should start?
Set rngDestin = wsPE.Cells(.Rows.Count + .Row, "R")
I added the code. When I F8 through once wsPE.UsedRange.Row value is 1 and wsPE.UsedRange.Rows.Count value is 13708. When I F8 through a second time wsPE.UsedRange.Rows.Count is incremented by 1 to 13709.
Can't detect any errors but no data transfered from QT to PE.
Skip, here is what the code now looks like. I had to change With rngGMPCA to With rngDAFRPCA and (.Offset(r, 0).Value = rngDAFRPCA.Value) to (.Offset(r, 0).Value = rngGMPCA.Value)
for the loop to execute.
The Destin here should be the same as if data was being transfered from wsQT except the...
What part of your code does this?
If rngDAFRPCA = rngGMPCA Then
Sheets("First QT").Select
rngToCopy.Select
Selection.Copy
Sheets("Prepared_Expense").Select
rngDestin.Select
Selection.PasteSpecial Paste:=xlValues...
Does you code say as long as the GMPCA equals the DAFRPCA Then do what ever is in the Do loop? Which at the moment is nothing. If this is true then the Do loop needs to copy the rngCopyTo to rngDestin and move to the next row. Putting the code where your questions into the loop are does not...
The code below inialized the variables. Do I put this above your With statement?
'This initializes the variable for the first match.
Set rngDAFRPCA = Sheets("Prepared_Expense").Range("Q2").Offset(1, -15) 'Range _
must be in the same row as the start of DAFRPCA data.
Set rngGMPCA...
Process:
There are two different systems (Grants Management (GM) and Budget Execution (BE)) that are alleged to track the same expenditures but each uses a different characterization of expenditures. The GM expenditures are presented by associated with individual grants. The BE expenditures is...
I incorporated the code you suggested after the "Else" and commented out my original code. When I run the code now there is no transfer of data when the DAFRPCA changes. If the code was matching on A100 and the DAFRPCA is now A101, the last line where the DAFRPCA is A100 has no data transferred...
1. The Find method requires a variant and not a range object as an argument.
The code works for the first 325 records. There are 16 instances where it must fine a match and it appears to do so. Only when there are two consecutive non-matches does it invoke a runtime error and stop. Is this...
I am matching data in cells on different worksheets in the same workbook. When the data matches I copy some data from sheet 1 to sheet 2.
If they do not match I insert a string where the data would have gone on sheet 2. In many cases there will be multiple records with the same unmatchable data...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.