#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default creating a button

Hi I want to create a button in the spreadsheet so it updates a value in one
cell and moves it to another specified cell for example in A1 the number is 5
I want that copied to say C5, and then the next number I put in A1, when I
press that button again and it inserts it in C6 and so on.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default creating a button

Jonathan

Without a button by using Event Code.

Assumes C4 has an entry of some sort and remainder of Column C is blank.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$1" And Target.Value < "" Then
If IsNumeric(Target.Value) Then
ActiveSheet.Cells(Rows.Count, 3).End(xlUp) _
.Offset(1, 0).Value = Target.Value
End If
End If
stoppit:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the code into that module.


Gord Dibben MS Excel MVP


On Tue, 20 Mar 2007 15:00:38 -0700, JonathanW
wrote:

Hi I want to create a button in the spreadsheet so it updates a value in one
cell and moves it to another specified cell for example in A1 the number is 5
I want that copied to say C5, and then the next number I put in A1, when I
press that button again and it inserts it in C6 and so on.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 57
Default creating a button

With a button from the Forms toolbar:

Sub Cell_Mover()
Dim strInput As String
strInput = Range("A1").Value
Range("C5").Select
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True
ActiveCell.Value = strInput
End Sub

"JonathanW" wrote:

Hi I want to create a button in the spreadsheet so it updates a value in one
cell and moves it to another specified cell for example in A1 the number is 5
I want that copied to say C5, and then the next number I put in A1, when I
press that button again and it inserts it in C6 and so on.

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
Creating a clickable button S Davis Excel Worksheet Functions 1 September 8th 06 04:53 PM
Creating a Print Button william4444 New Users to Excel 3 June 22nd 06 07:33 AM
Creating a Macro Button to Extract Data william4444 New Users to Excel 0 June 22nd 06 02:53 AM
creating a reset button 1vagrowr Excel Discussion (Misc queries) 1 December 17th 05 01:06 PM
Creating button as cell jpizzle Excel Discussion (Misc queries) 1 June 1st 05 01:22 PM


All times are GMT +1. The time now is 09:38 PM.

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

About Us

"It's about Microsoft Excel"