LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Prompt to overwrite

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
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
Save As / Overwrite Brent E Excel Discussion (Misc queries) 4 October 23rd 08 08:19 PM
getting rid of copy/overwrite prompt on Save John Collins Excel Discussion (Misc queries) 2 November 21st 06 11:59 PM
Overwrite Protection marcus.ucdavis Excel Discussion (Misc queries) 0 August 16th 06 04:53 PM
save prompt for user exit, but no save prompt for batch import? lpj Excel Discussion (Misc queries) 1 February 25th 06 02:08 AM
Q: overwrite during saveas JIM.H. Excel Discussion (Misc queries) 1 January 5th 05 07:27 PM


All times are GMT +1. The time now is 09:25 AM.

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"