Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Change cell after macro

I have a value in sheet1 AM4 of 101 along with a macro assigned to a text
box. I would like the value in AM4 to change to 102 after macro is run.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Change cell after macro

Make something like this the last line of your macro

Sheets("Sheet1").Range("AM4").Value = Sheets("Sheet1").Range("AM4").Value + 1


Mike

"bgkgmg" wrote:



I have a value in sheet1 AM4 of 101 along with a macro assigned to a text
box. I would like the value in AM4 to change to 102 after macro is run.

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Change cell after macro

hello , mike , it hopefully work!
i have simillar issue with cell , but is a verion compatibily,
when we migrating a previous Excel xls project call to the com objects for
each task, in upgrade to office 2007, using Vsto by C#, we change out some
the template's cs, code for comptible to office 2007 , in the scope of:
sheet. column object, column's max size -- in sheet .Column range from
(AA:ZZ) to (A:IV)

cAll= (Excel.Range)this.Sheet.Columns[ "A:IV", Type.Missing ];

b/c office 2007 is change to IV. then the column cell is not creating in
design time of the project runing , there is a exception throw :

system.Runtime.InteropServices.COMException (0x80020005): Type mismatch.
we not yet know how to ..
have any one got that ? any suggetion? you help are highly appreciated.

Chan


"Mike H" wrote:

Make something like this the last line of your macro

Sheets("Sheet1").Range("AM4").Value = Sheets("Sheet1").Range("AM4").Value + 1


Mike

"bgkgmg" wrote:



I have a value in sheet1 AM4 of 101 along with a macro assigned to a text
box. I would like the value in AM4 to change to 102 after macro is run.

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Change cell after macro



"Mike H" wrote:

Make something like this the last line of your macro

Sheets("Sheet1").Range("AM4").Value = Sheets("Sheet1").Range("AM4").Value + 1
It worked but leads me to additional question. When I run macro it moves info from invoice 101 to a master sheet row invoice 101 along with locking cells and protecting sheet which is what I want. Without your formula when I enter 102 and run macro the IF Then statement moves info to 102. With your formula added sheet1 shows 102 but master sheet remains protected.

I hope you understand and thanks




Mike

"bgkgmg" wrote:



I have a value in sheet1 AM4 of 101 along with a macro assigned to a text
box. I would like the value in AM4 to change to 102 after macro is run.

Thanks

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 that will change the font of a cell if i change a value jk Excel Discussion (Misc queries) 2 July 29th 08 04:39 PM
Event Macro - On Cell Activate - Change Cell Format [email protected][_2_] Excel Programming 7 November 7th 07 03:36 AM
macro to look down cells and if negative in the right of the cell change to left of the cell [email protected][_2_] Excel Programming 9 August 7th 07 12:06 PM
Cell value change to trigger macro (worksheet change event?) Neil Goldwasser Excel Programming 4 January 10th 06 01:55 PM
Please help! Macro to change cell contents based on cell to the left Jennifer[_8_] Excel Programming 7 March 4th 04 01:06 AM


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