PC Review


Reply
Thread Tools Rate Thread

Change cell after macro

 
 
bgkgmg
Guest
Posts: n/a
 
      25th Sep 2008
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 With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      25th Sep 2008
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

 
Reply With Quote
 
chan
Guest
Posts: n/a
 
      26th Sep 2008
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

 
Reply With Quote
 
bgkgmg
Guest
Posts: n/a
 
      26th Sep 2008


"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 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
Event Macro - On Cell Activate - Change Cell Format Bob@1800-mail.com Microsoft Excel Programming 7 7th Nov 2007 03:36 AM
macro to look down cells and if negative in the right of the cell change to left of the cell amorrison2006@googlemail.com Microsoft Excel Programming 9 7th Aug 2007 12:06 PM
Run Macro from cell change THEN select adjacent cell =?Utf-8?B?bXNsYWJiZQ==?= Microsoft Excel Programming 4 24th Dec 2006 06:49 PM
Cell value change to trigger macro (worksheet change event?) =?Utf-8?B?TmVpbCBHb2xkd2Fzc2Vy?= Microsoft Excel Programming 4 10th Jan 2006 01:55 PM
Please help! Macro to change cell contents based on cell to the left Jennifer Microsoft Excel Programming 7 4th Mar 2004 01:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:16 AM.