LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default VBA code to move contents from one cell to another


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
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
Move cell contents with macro Peridot Excel Discussion (Misc queries) 4 September 30th 09 03:35 PM
VBA Question: Move cell contents if... Scott Wagner Excel Programming 6 March 17th 06 10:03 PM
move cell contents David L Excel Discussion (Misc queries) 13 November 24th 05 08:18 PM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM
How to move cell contents Stephane Excel Discussion (Misc queries) 6 January 13th 05 12:49 AM


All times are GMT +1. The time now is 10:17 PM.

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"