Good Morning, I am hoping Someone can help me here. I am trying to copy 2 named ranges (2 columns) and paste them into 2 different named ranges (again 2 columns) on the same worksheet (code below)
The VBA works great, with a notable exception. 22 of the 149 rows copy wrong. The formulas in the originating columns are all the same, but when copied, (recreated several times) the ending numbers for those 22 are wrong (same 22 rows, same ending numberson each row, but no number in the column is the same)
Any help is TRULY appreciatedThisWorkbook.Worksheets("eemaster").Range("YrElig").Copy Range("PrvElig").PasteSpecial xlPasteValuesAndNumberFormats ThisWorkbook.Worksheets("eemaster").Range("YrBank").Copy Range("PrvBank").PasteSpecial xlPasteValuesAndNumberFormats Application.CutCopyMode = False
Last edited by fhill; 10-25-2011 at 01:42 PM.
*BUMP*
Okay, now that I have sat back and contemplated my evil coding, I realized that since both columns have calculations which rely on each other, I have to actually copy the range into a new range as values, and THEN move them to the correct places, then deleting said temporary ranges.
This eliminates the "altered" data I was seeing.ThisWorkbook.Worksheets("eemaster").Range("YrElig").Copy Range("EligTemp").PasteSpecial xlPasteValuesAndNumberFormats ThisWorkbook.Worksheets("eemaster").Range("YrBank").Copy Range("BalTemp").PasteSpecial xlPasteValuesAndNumberFormats ThisWorkbook.Worksheets("eemaster").Range("EligTemp").Copy Range("PrvElig").PasteSpecial xlPasteValuesAndNumberFormats ThisWorkbook.Worksheets("eemaster").Range("BalTemp").Copy Range("PrvBank").PasteSpecial xlPasteValuesAndNumberFormats Application.CutCopyMode = False ThisWorkbook.Worksheets("eemaster").Range("EligTemp", "BalTemp").ClearContents
If anyone has a simpler (more elegant) way of doing this I am open to suggestions.
On a side note, how DO you delete your own post?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks