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: 168
Default Re-enter space in a cell if user accidently deletes it

On Jan 9, 2:40*pm, "James" wrote:
I have a column than I input names in. Each cell of that column already has
a space entered in it, so that autocomplete will function. However, if a
user deletes an entry in the column, he deletes the space also. I tried the
following sub in the worksheet change event to solve this problem:

If Not Intersect(Target, wshDatabase.Range("Names")) Is Nothing Then If
Target.Value = "" Then Target.Value = " "

It works fine unless the user selects more than one cell when he deletes
data, in which case I get a "type mismatch" error. How do I correct my sub
so it works with a multi cell selection?


First line of event
if target.count1 then 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
User Form deletes previous entry Bill the Newbie[_2_] Excel Programming 0 February 10th 09 06:12 PM
Detecting When User Deletes a Sheet [email protected] Excel Programming 2 July 20th 07 03:12 PM
Detecting when a user deletes a row Wescotte Excel Programming 7 January 18th 06 04:26 PM
Detecting when a user deletes a row Wescotte Excel Worksheet Functions 0 November 8th 05 12:01 AM
Detecting when Excel user inserts or deletes a row wjewell Excel Programming 3 November 2nd 05 09:02 AM


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