Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
keithl816
 
Posts: n/a
Default excel to access problem


Hi Secret Squirrel,

The code below is what I used. This code is placed in "This Workbook".
After you complete data entry, close the workbook and reopen it, it
should erase your data automatically. Change sheet name as needed. This
code doesn't need a button.


Code:
--------------------

Private Sub Workbook_Open()
Dim ToErase As Range, EraseRows As Integer

Set ToErase = Sheets("Sheet1").UsedRange
EraseRows = ToErase.Rows.Count - 1
If EraseRows 0 Then
Set ToErase = ToErase.Offset(1, 0).Range("1:" & EraseRows)
ToErase.ClearContents
End If
End Sub

--------------------


Larry


--
keithl816
------------------------------------------------------------------------
keithl816's Profile: http://www.excelforum.com/member.php...o&userid=21287
View this thread: http://www.excelforum.com/showthread...hreadid=474422

Reply
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
Financial modelling from Excel to Access Huyeote Excel Discussion (Misc queries) 3 March 9th 11 03:59 PM
Access Excel Linked Text and Number Issues Scott Excel Discussion (Misc queries) 2 October 4th 05 09:24 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM
Send Excel data to Access through button julesferreira Excel Discussion (Misc queries) 1 June 17th 05 07:30 PM
Excel user desires to learn ABC of Access Hari Excel Discussion (Misc queries) 1 December 3rd 04 02:32 AM


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