Problem with VBA Machine Code vs Binary...Maybe?

SBF12345

Well-known Member
Joined
Jul 26, 2014
Messages
614
I have a bit of code that is returning dates values inaccurately. The search values that are generating the problem all begin with 2 as in February. Dates that begin with 2 are being found as December dates. Its as if the find function is adding a "1" before the two somehow. Not sure what to think here? Is this a machine code vs binary problem perhaps?

Code:
RngEnd2 = Cells.Find(What:=EndDate, After:=ActiveCell, LookIn:=xlFormulas, _        LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Address(1, 1)
 
Try....

Code:
EndDate.Resize(, 2).Offset(zz, 0).Copy
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
I have something wrong with my snytax on the other line in the loop. object defined error

Code:
Sheets("LowDistCharts").Range(Cells(5, aa + 10)).Offset(zz, 0).PasteSpecial xlPasteValues
 
Upvote 0
Get rid of Range.
Code:
Sheets("LowDistCharts").Cells(5, aa + 10).Offset(zz, 0).PasteSpecial xlPasteValues
 
Upvote 0
Back to the first line in this short For loop. With the line below the date value is pasting into the destination sheet but it is including no adjacent column data. When the data is pasted into the destination sheet it pastes with two adjacent columns, but the right side is blank. Any ideas why this might be occurring?

Code:
EndDate.Resize(, 2).Offset(zz, 0).Copy
 
Upvote 0
Disregard. The EndDate range variable is using an incorrect sheet as a basis from which to copy.
 
Upvote 0

Forum statistics

Threads
1,215,675
Messages
6,126,153
Members
449,294
Latest member
Jitesh_Sharma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top