Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Adding to the cell value with a macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Adding to the cell value with a macro

Private Sub CommandButton1_Click()
ActiveCell.Offset(0, -1) = ActiveCell.Offset(0 -1).Value + 1
End Sub



"S.S." wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Adding to the cell value with a macro

Should have mentioned that the code is based on the button being from the
Control Toolbox and should be loaded by right clicking the buttonView Code
to open the code window.


"S.S." wrote in message
...
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
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
Macro for adding text from one cell to another cell 27Jack Excel Programming 6 August 15th 08 11:26 PM
Adding a Function to a cell when inserting a row from a macro Mbarnes Excel Worksheet Functions 0 May 31st 06 04:38 PM
adding a macro to a cell enyaw Excel Programming 1 April 26th 06 12:28 PM
adding cell data into a macro to allow specified information filte mattguerilla Excel Programming 3 May 24th 05 09:40 PM
adding a line at the end of a macro to name the cell yippy Excel Programming 2 January 3rd 04 02:15 AM


All times are GMT +1. The time now is 05:55 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"