Link to home
Start Free TrialLog in
Avatar of Naresh Patel
Naresh PatelFlag for India

asked on

TT Master Button

I had this question after viewing TT Reverse Entry.

Hi experts,

Need a help with code which execute module macro one by one.
i had created
Sub MasterImportUpdating()
Call SplitImportData
Call AddColumn
Call CopyFormulas
Call SortColumn
Call UpdatingMaster
Call ReversError
End Sub

Open in new window

it leads to error
and need to add one more task in posted macro - after last module end ...needs to clear all data  from sheet Import and print Done in Cell A1.

need to assign  this macro to button existed in sheet Import

See Attached

Thanks
-TT-WIP-D.xlsm
SOLUTION
Avatar of Ejgil Hedegaard
Ejgil Hedegaard
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Naresh Patel

ASKER

Leads To Error - if i execute one by one from module no error but if i excute master macro button it leads to errorUser generated image
See attached new sample data added in sheet sample data
---TT-WIP-D-1.xlsm
When I'm testing your file I keep getting an overflow error on this line in the sub UpdatingMaster

wsMaster.Range("AC" & rngFound.Row).Resize(1, 7).Value = c.Offset(, 29).Resize(1, 7).Value

Open in new window


Is that the same error that you get?
Yes Same error
Try changing that line to this:

wsMaster.Range("AC" & rngfound.Row, "AC" & rngfound.Row + 7) = Range("A" & c.Row & ":G" & c.Row).Offset(, 29).Value

Open in new window

wsMaster.Range("AC" & rngFound.Row).Resize(1, 7).Value = c.Offset(, 29).Resize(1, 7).Value
Not sure that is correct, because specification for TT Add/ Update says columns AD to AJ, and above use AC to AI

I don't see any reason why it does not work, and the file I send run without errors.
Rgonzo1971 made the code, perhaps he can find the reason.

I would suggest to insert the values one by one, by replacing the line with this, then it runs.

For i = 1 To 7
     wsMaster.Cells(rngfound.Row, 29 + i).Value = c.Offset(, 29 + 1).Value
Next i

AC is column number 29, so the values replaced are for columns AD to AJ.
it is my start up in VBA ...i cant understand core VBA coding ...please suggest what   i do?

Thanks
if i run Sub MasterImportUpdating() on old data it is working fine (which is being in sheet sample data in my original post ) but when i run on new data that error pop up....see my 2nd attached file.

Thanks
I used your second file when updating that line. It works fine for me. Are you still getting an error with the update that I suggested?
just out of context ...seen this in EE Lucky draw....seems i am in the race :) :) ;)
Are you still getting the overflow error?
yes
The problem is the data in column AG. you have it formatted as "Custom => d-mmm-yy" Whatever is in that column is what is causing the overflow. Those are not dates. when nI change that column to plain text it works fine.
if that is the case then cant we add one more sub which select all column and format as general....before executing Module M6_UpdatingMaster - Sub UpdatingMaster().

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Perfect and i am in dilemma ...please understand
No worries, glad to help.