This code needs a major operation

RAJESH1960

Banned for repeated rules violations
Joined
Mar 26, 2020
Messages
2,313
Office Version
  1. 2019
Platform
  1. Windows
Hello guys,
I am sharing this workbook which is updated and working. I want to make the work of the user more easy and less complicated.
When I receive the data to be matched with Portal, Purchases or Journal or any other sheet, I had to insert 2 help columns in those sheet/s. This was to help me understand and create this app. Now, I want to delete these columns and make this more easy. I just have to insert the sheets to be matched with portal and press the button. If I delete the columns, the code will obviously not work. So, I need your expertise to get the same result without those columns. The Edited Portal, Matches and mismatches sheets should show which data is from which sheet in column O as it is showing now and also Tally in column B. Column B would be easier as you will have to fill down all the empty cells with Tally.
Also, When I run the code the second time without deleting the Edited Portal, Matches and mismatches sheets, it clears the old data and posts the new data. I have created a new sub total sheet but the code has not included to clear the old data in sub total. Hence I get an error. If the sub total sheet is cleared with the code and recreated within the code, it will be just great.
Thank you in advance.
Finale.xlsm
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hello JohnnyL. I am back.
I tested your code with the data I shared with you and it worked perfect. I got 3 different data today and tested and I am getting the same error in all the 3 data. Run-Time Error 13, Type Mismatch at this line
Rich (BB code):
            .Range("M" & SheetRow).Value2 = DateValue(.Range("M" & SheetRow))                       '   Write the Serial Date to the cell
What does this line exactly do. ?
 
Upvote 0
I commented that particular line and again ran the code. The weird part is that it worked. I didn't want to continue without that line without your say so. Without that line, it is not displaying the dates incolumn M posted in the edited portal sheet though.
 
Upvote 0
That line takes a date and converts it to the serial date that excel uses.
 
Upvote 0
Takes the date from Portal sheet..?
 
Upvote 0
Rich (BB code):
For SheetRow = 2 To DestinationLastRow                                                      ' Loop through rows of the destination sheet
            .Range("F" & SheetRow).Value = .Range("F" & SheetRow).Text                              '   Write the TextDate to the cell
            '.Range("M" & SheetRow).Value2 = DateValue(.Range("M" & SheetRow))                       '   Write the Serial Date to the cell
        Next
It is writing the date to the destination sheet as per your comments. The tally dates are posted correctly but the Portal row dates have a slash instead of a dash in column F and that is ok ok . But it is not filling the O column at all.
 
Upvote 0
It sounds like your source data is in a different format than your previous examples. If you want to, upload the workbook that you are having issues with, so we can have a look see.
 
Upvote 0

Forum statistics

Threads
1,215,429
Messages
6,124,840
Members
449,193
Latest member
MikeVol

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