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

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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