PC Review


Reply
Thread Tools Rate Thread

Adding to the cell value with a macro

 
 
S.S.
Guest
Posts: n/a
 
      25th Apr 2010
I would like to select a cell with a product code (let's say cell B6 contains
Part #ABC). I would like to activate that cell, click on a button to run a
macro to change the quantity (lets say quantitiy is in cell A6.) If A6 is
currently 0, a click would change it to 1. if it is 2, a click would change
it to 3. On a sheet with many product numbers, the macro would start at the
active cell, jumpone column to the left, and "1" and return to the cell to
the right. I know this is possible, but can not seem to get there. Thanks in
advance for your help
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      25th Apr 2010
Private Sub CommandButton1_Click()
ActiveCell.Offset(0, -1) = ActiveCell.Offset(0 -1).Value + 1
End Sub



"S.S." <S.S.@discussions.microsoft.com> wrote in message
news:AD2BE255-B824-4710-A805-(E-Mail Removed)...
>I would like to select a cell with a product code (let's say cell B6
>contains
> Part #ABC). I would like to activate that cell, click on a button to run
> a
> macro to change the quantity (lets say quantitiy is in cell A6.) If A6 is
> currently 0, a click would change it to 1. if it is 2, a click would
> change
> it to 3. On a sheet with many product numbers, the macro would start at
> the
> active cell, jumpone column to the left, and "1" and return to the cell to
> the right. I know this is possible, but can not seem to get there. Thanks
> in
> advance for your help



 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      25th Apr 2010
Should have mentioned that the code is based on the button being from the
Control Toolbox and should be loaded by right clicking the button>View Code
to open the code window.


"S.S." <S.S.@discussions.microsoft.com> wrote in message
news:AD2BE255-B824-4710-A805-(E-Mail Removed)...
>I would like to select a cell with a product code (let's say cell B6
>contains
> Part #ABC). I would like to activate that cell, click on a button to run
> a
> macro to change the quantity (lets say quantitiy is in cell A6.) If A6 is
> currently 0, a click would change it to 1. if it is 2, a click would
> change
> it to 3. On a sheet with many product numbers, the macro would start at
> the
> active cell, jumpone column to the left, and "1" and return to the cell to
> the right. I know this is possible, but can not seem to get there. Thanks
> in
> advance for your help



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for adding text from one cell to another cell 27Jack Microsoft Excel Programming 6 15th Aug 2008 11:26 PM
Adding a Function to a cell when inserting a row from a macro =?Utf-8?B?TWJhcm5lcw==?= Microsoft Excel Worksheet Functions 0 31st May 2006 04:38 PM
adding a macro to a cell =?Utf-8?B?ZW55YXc=?= Microsoft Excel Programming 1 26th Apr 2006 12:28 PM
adding cell data into a macro to allow specified information filte =?Utf-8?B?bWF0dGd1ZXJpbGxh?= Microsoft Excel Programming 3 24th May 2005 09:40 PM
adding a line at the end of a macro to name the cell yippy Microsoft Excel Programming 2 3rd Jan 2004 02:15 AM


Features
 

Advertising
 

Newsgroups
 


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