Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Trina wrote: Thanks, Edward. Having trouble implementing this as I have little experience with buttons and code writing. Once I create the button, can I just copy your code into the code window, replacing the "page 1" and "page 2" with the actual sheet names? Do I need to enclose the sheet names in quotations? How do I get the button to become active? thanks. "Edward" wrote: Trina wrote: I want to create a page in Excel (lets call it page 1) where I can enter a Job Name, and once entered, click a button and have that Job Name move to the next available space on a master Job List, located on another page (page 2). At the same time I want the Job Name entered on page 1 to disappear, so I can enter another Job name and repeat the process. I have not used VBA before, but it sounds like this may be possible through code. Any help would be appreciated. Thanks. This is a pretty basic problem with many, many ways to implement. I will detail one way. After you put your button on page 1, assign the click event to it and put in code something like: x = Sheets("page 1").Cells(1, 1).Value Sheets("page 2").Cells(1, 2) = Sheets("page 2").Cells(1, 2) + 1 rowNum = Sheets("page 2").Cells(1, 2).Value Sheets("page 2").Cells(rowNum, 1) = x Sheets("page 1").Cells(1, 1) = "" Where on "page 2" cell B1 (Sheets("page 2").Cells(1, 2)) will store the current record count of your jobs and on "page 1" cell A1 (Sheets("page 1").Cells(1, 1)) is where you will store your data. If you right-click the button the Button_Click macro should be highlighted. Just click create and put your code in there. Your sheet name needs to go in quotes in this implementation. There are other ways to refer to sheets but this will get you started. The button will be active right from the start. PS. Please do not top-post. It makes these threads tough to read. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Move cell contents with macro | Excel Discussion (Misc queries) | |||
VBA Question: Move cell contents if... | Excel Programming | |||
move cell contents | Excel Discussion (Misc queries) | |||
Macro to remove contents of cell and move all other contents up one row | Excel Discussion (Misc queries) | |||
How to move cell contents | Excel Discussion (Misc queries) |