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: 72
Default Saving over a range

I have the following code which makes a copy of a portion of my spreadsheet
at the "OK" command event and saves to the next available cell in the Data
worksheet.

Private Sub cmdOK_Click()
Dim rCell As Range
With Application.ThisWorkbook
Set rCell = .Worksheets("Data").Range("A65536").End(xlUp).Offs et(1, 0)
Worksheets("STD Calc").Range("B14:N33").Copy
rCell.PasteSpecial Paste:=xlValues
Application.CutCopyMode = False
End With
Unload Me
End Sub

Prior to the OK button being clicked, the user has entered via a user form,
a beginning date for a two week payroll period. That date range and
coresponding data is then copied with the code above.
What I need to add in is a way to check for an occurance where the user
enters a date that already exists on the Data worksheet and the new copy is
saved right over the top of the old data that coresponds to that same date
range. This will happen if an error is made for a payroll period and the
user needs to correct it by going back to that payroll period. In other
words, I don't want to save the corrections to the next empty cell, I want it
to copy over the original data which was entered incorrectly and is now being
corrected.

How can I do that?

Thanks for any ideas.
 
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
Saving a pre-determined range of cells as text? [email protected] Excel Discussion (Misc queries) 2 March 27th 07 11:58 PM
Saving the activecell range for later use Tim Coddington Excel Programming 0 December 12th 04 09:12 PM
Saving Range of Cells as Image File [email protected] Excel Programming 0 August 23rd 04 02:51 PM
Saving Range Locatoin into a Variable Jake Marx Excel Programming 4 September 10th 03 10:08 PM
Saving Range Locatoin into a Variable Bob Phillips[_5_] Excel Programming 0 September 10th 03 09:13 PM


All times are GMT +1. The time now is 06:44 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"