Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Visual Basic insert formula

Hi,

I am trying to set a macro to do the following: insert the formula in the active cell (or in each cells selected). Formula: "=round( 'activecell value' ;0)"

The activecell could have a number like: 5,68 or a formula: A1+A2.

Can someone help!

Thanks a lot.
  #2   Report Post  
Junior Member
 
Posts: 19
Default

Quote:
Originally Posted by Pavlov Bell View Post
Hi,

I am trying to set a macro to do the following: insert the formula in the active cell (or in each cells selected). Formula: "=round( 'activecell value' ;0)"

The activecell could have a number like: 5,68 or a formula: A1+A2.

Can someone help!

Thanks a lot.
Hi,

Best way to begin is to use the Macro Recorder.

Then edit that code as necessary.

David
  #3   Report Post  
Junior Member
 
Posts: 18
Default

Quote:
Originally Posted by David of XL Plus View Post
Hi,

Best way to begin is to use the Macro Recorder.

Then edit that code as necessary.

David

Hi,

as David already told to you, use macro recorder.

The following code is made by macrorecorder

Sub NoDecimals()
Selection.NumberFormat = "0"
End Sub

***
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
Adding a dymanic formula to a cell using visual basic Ian Web Excel Discussion (Misc queries) 2 September 28th 06 09:59 PM
excel formula - possibly visual basic method David Excel Discussion (Misc queries) 2 September 21st 06 09:55 PM
Visual basic Check Box and the IF formula dingo33 Excel Discussion (Misc queries) 3 February 15th 06 04:57 PM
changing the visual basic in office 2003 to visual studio net bigdaddy3 Excel Discussion (Misc queries) 1 September 13th 05 10:57 AM
Formula in Visual Basic For Excel imej-clavier Excel Discussion (Misc queries) 2 December 23rd 04 01:43 PM


All times are GMT +1. The time now is 10:57 AM.

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"