LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 98
Default Duplicate Entries

On Oct 5, 3:48*pm, Paul Robinson wrote:
Hi
You have provided no information which might help someone else to
solve your problem.

"Transfer data" - is this done using code? What is the code?
"Generate Report" - is this done using code? What is the code?

regards
Paul

On Oct 5, 10:55*am, Heera wrote:



Hi All,


I have 5 users working on a macro. All of them are using different
workbooks from there desktops but the macro is same.


At the end of the when the work is done all of them transfer their
data to a workbook(well I call it datadump) which is located in shared
drive. Some times when the users transfers the data to the datadump
workbook duplicate entries are created.


For an example: User one has done ten case studies in a day, at the
end of the day before leaving he will transfer the data to the
datadump workbook which is on shared drive and on the other day when i
generate the report I see 20 case studies. It has happned very few
times but I am not able to understand the cause.


I dont know what is going wrong. Please help....


Regards
Heera Chavan- Hide quoted text -


- Show quoted text -


Hi Paul,

Thank you for your reply here is my script. Summary tab is in the user
workbook and it contains the details of his case studies which he has
done during the day. And the user transfer's the data from summary tab
to "Raw Data" tab of Datadump workbook which is in shared drive. I
hope this will help you to understand the issue. However I think the
problem is with the network but this issue is giving me lot of
problems.

Sub Transfer()

Application.ScreenUpdating = False
Sheets("Summary").Select
Dim DBPath As String 'delare the variable for database path
Dim DBName As String 'delare the variable for database Name
Dim Myfile As String



DBPath = ThisWorkbook.Sheets("Cover").Range("B1").Value 'the address
where the database path is mentioned in the macro workbook.
DBName = ThisWorkbook.Sheets("Cover").Range("B5").Value 'the address
where the database file name is mentioned in the macro workbook.

Myfile = Dir(DBPath & "\" & DBName)

If Myfile = "" Then

MsgBox "Macro cannot continue with this operation because of the
following possibilities." & vbCrLf & _
"1. Mentioned Path is not accessable." & vbCrLf & "2. Required
File is not available" & vbCrLf & _
"3. Correct File name or File Path is updated." & vbCrLf & "4.
Network is disconnected.", vbInformation, Title:="FSS"
Errorhandel (bstatusb)
Range("A7").Select
Exit Sub

End If

Application.DisplayAlerts = False
Workbooks.Open Filename:=(DBPath & "\" & DBName)

Application.DisplayAlerts = False

If ActiveWorkbook.ReadOnly = True Then

Application.DisplayAlerts = False
Application.WindowState = xlMinimized
MsgBox "Other user is updating data in the database. Try to
transfer the data after some time.", vbInformation, Title:="FSS"
Errorhandel (bstatusb)
Windows(DBName).Close
ThisWorkbook.Activate
Range("A7").Select
Exit Sub

End If

Sheets("Raw Data").Select
ActiveSheet.Unprotect Password:="youknowit@$1"

ThisWorkbook.Activate

Row("6:" & Cells(60000, 1).End(xlUp).Row).Entirerow.select
Selection.Copy

Windows(DBName).Activate
Cells(60000, 1).End(xlUp).Offset(1,0).Select


Sheets("Raw Data").Select
Range("A1").Select
ActiveSheet.Protect Password:="youknowit@$1"
ActiveSheet.Paste
Application.CutCopyMode = False
Selection.RowHeight = 15
Range("A1").Select
ActiveSheet.Protect Password:="youknowit@$1"
ActiveWorkbook.Save

If Workbooks(DBName).Saved Then

Windows(DBName).Close
ThisWorkbook.Activate
Selection.Copy
Sheets("BackupSheet").Select
Cells(80000, 1).End(xlUp).Offset(1, 0).Select
ActiveSheet.Paste
Application.CutCopyMode = False
Sheets("Summary").Select
ActiveSheet.Unprotect Password:="youknowit@$1"
Selection.EntireRow.Delete Shift:=xlUp
ActiveCell.Select
ThisWorkbook.Save
ActiveSheet.Protect Password:="youknowit@$1"

Else

Application.DisplayAlerts = False
Windows(DBName).Close
ThisWorkbook.Activate
Range("A7").Select
ThisWorkbook.Save
MsgBox "Due to technical problem the data is not saved in the
database." & Chr(10) & _
"Kindly trasfer the data once again."

End If


MsgBox "Done.", vbInformation

Exit Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Entries Mario[_4_] Excel Discussion (Misc queries) 3 February 26th 11 04:31 AM
duplicate entries HR Director Excel Worksheet Functions 5 January 1st 09 06:19 AM
Getting rid of not quite duplicate entries el_grimley Excel Worksheet Functions 4 August 10th 05 02:52 PM
Duplicate entries James[_20_] Excel Programming 1 February 27th 04 02:49 AM
Duplicate entries Liz[_4_] Excel Programming 1 November 6th 03 05:06 PM


All times are GMT +1. The time now is 11:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"