A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Fill cells automatically when cleared



 
 
Thread Tools Display Modes
  #1  
Old March 8th 17, 12:26 PM posted to microsoft.public.excel.worksheet.functions
R0nald
external usenet poster
 
Posts: 3
Default Fill cells automatically when cleared

Hello all,

Is there any way cells get automatically populated with certain value when cleared or made empty?

Example,

Value to put on empty cells: 1234

A1 = 11
A2 = empty
A3 = 22

If the automated fill works the cells should have:

A1 = 11
A2 = 1234
A3 = 22

If I empty A1 then 1234 should be put automatically in it.
If I fill A2 with 33 then A2 should contain 33 until I clear it, then it should have 1234 again.

Appreciate any help on this question.

Ronald.
Ads
  #2  
Old March 8th 17, 12:33 PM posted to microsoft.public.excel.worksheet.functions
Claus Busch
external usenet poster
 
Posts: 3,448
Default Fill cells automatically when cleared

Hi,

Am Wed, 8 Mar 2017 04:26:04 -0800 (PST) schrieb R0nald:

> Value to put on empty cells: 1234
>
> A1 = 11
> A2 = empty
> A3 = 22
>
> If the automated fill works the cells should have:
>
> A1 = 11
> A2 = 1234
> A3 = 22


try:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub

If Len(Target) = 0 Then Target = 1234
End Sub


Regards
Claus B.
--
Windows10
Office 2016
  #3  
Old March 8th 17, 03:33 PM posted to microsoft.public.excel.worksheet.functions
R0nald
external usenet poster
 
Posts: 3
Default Fill cells automatically when cleared

Thanks Claus!
Despite of all it doesn't do anything :-(

What I did: Just copy paste it on a new module I've created on a new workbook.....

Do I miss something or did you assume I handle it differently?

Best regards.

Ronald.
  #4  
Old March 8th 17, 03:50 PM posted to microsoft.public.excel.worksheet.functions
Claus Busch
external usenet poster
 
Posts: 3,448
Default Fill cells automatically when cleared

Hi,

Am Wed, 8 Mar 2017 07:33:53 -0800 (PST) schrieb R0nald:

> Despite of all it doesn't do anything :-(
>
> What I did: Just copy paste it on a new module I've created on a new workbook.....
>
> Do I miss something or did you assume I handle it differently?


this is a worksheet event macro. Right click on the sheet tab of the
expected sheet => Show Code and paste the code into the code window.


Regards
Claus B.
--
Windows10
Office 2016
  #5  
Old March 9th 17, 01:19 AM
Hồ Trịnh Hồ Trịnh is offline
Banned
 
First recorded activity by ExcelBanter: Mar 2017
Posts: 1
Default

Tại sao nên in quảng cáo tại công ty in ấn Kim Minh Th*nh

+ Bạt in hiflex được lấy từ đầu nguồn, đảm bảo giá nguyên v*t liệu in ấn tốt nhất

+ Hệ thống máy in hiflex mực dầu, máy in khổ lớn trực tiếp thực hiện in, khổ in chiều rộng l* 3.2m, chiều d*i in ấn không hạn chế, in mọi k*ch thước phông nền như bạn mong muốn

+ Quy trình l*m việc chuyên nghiệp, rút ngắn nhiều công đoạn rườm r*, mang đến cho quý khách những điều kiện tốt nhất.

+ T*p thể thiết kế thiết kế v* in ấn gi*u kinh nghiệm.
Nguồn : in băng rôn
  #6  
Old March 15th 17, 07:56 PM posted to microsoft.public.excel.worksheet.functions
R0nald
external usenet poster
 
Posts: 3
Default Fill cells automatically when cleared

Thanks Claus.
All well now.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to automatically fill cells C Excel Programming 4 July 16th 09 04:35 PM
Undo Menu is Automatically Cleared jtarbell Excel Discussion (Misc queries) 1 November 15th 06 10:42 PM
Help using the 'If' function to automatically fill in other cells Bugaglugs Excel Worksheet Functions 3 August 21st 05 11:23 PM
automatically fill in a range of cells Maarten Excel Discussion (Misc queries) 1 April 29th 05 11:14 AM
need to fill cells automatically Feltond Excel Worksheet Functions 2 February 18th 05 10:56 PM


All times are GMT +1. The time now is 12:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 ExcelBanter.
The comments are property of their posters.