Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The portion of code below courtesy of Debra Dalgliesh(thanks again)
pastes data into cells B1:Z1. The problem I have is that it will overwrite existing data. I realise that the destination cells need testing and if data exists prompt the user (by messagebox?) for confirmation to overwrite/cancel. I would appreciate any help in achieving this. For Each ws In wbMaster.Worksheets strEmp = ws.Name For Each ws2 In wbMth.Worksheets If IsError(Application.Match(strEmp, _ ws2.Range("B1:Z1"), 0)) Then 'do nothing Else col = Application.Match(strEmp, _ ws2.Range("B1:Z1"), 0) ws2.Range(ws2.Cells(2, col + 1), _ ws2.Cells(LastRow, col + 1)).Copy _ Destination:=ws.Cells(2, i + 1) Exit For End If Next TIA Karen |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save As / Overwrite | Excel Discussion (Misc queries) | |||
getting rid of copy/overwrite prompt on Save | Excel Discussion (Misc queries) | |||
Overwrite Protection | Excel Discussion (Misc queries) | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
Q: overwrite during saveas | Excel Discussion (Misc queries) |