Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a clickable button | Excel Worksheet Functions | |||
Creating a Print Button | New Users to Excel | |||
Creating a Macro Button to Extract Data | New Users to Excel | |||
creating a reset button | Excel Discussion (Misc queries) | |||
Creating button as cell | Excel Discussion (Misc queries) |