Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default to run a command in a cell

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default to run a command in a cell

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook.

Sub Macro1()
Range("A1") = Now
End Sub

--From ToolbarsDrawingToolbarAutoShapesBasic Shapes select any shape you
like. say ("Bevel") and place that in your worksheet.

--Right click the shapeAssign Macro and select the macro to be assigned

--Now try Button click


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default to run a command in a cell

Did all but doesn't work. I use Excel 2007 is your solution also for this
version ?

The command to have the system date&time is =now()

must it be the same your code ?

"Jacob Skaria" wrote:

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook.

Sub Macro1()
Range("A1") = Now
End Sub

--From ToolbarsDrawingToolbarAutoShapesBasic Shapes select any shape you
like. say ("Bevel") and place that in your worksheet.

--Right click the shapeAssign Macro and select the macro to be assigned

--Now try Button click


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default to run a command in a cell

Hi again ;-)

it does work but it changes the field A1 but i want it to a cell that i want.
I click f.e. on A47 and click the button and then date&time appears in A47

"Steven Van Laethem" wrote:

Did all but doesn't work. I use Excel 2007 is your solution also for this
version ?

The command to have the system date&time is =now()

must it be the same your code ?

"Jacob Skaria" wrote:

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook.

Sub Macro1()
Range("A1") = Now
End Sub

--From ToolbarsDrawingToolbarAutoShapesBasic Shapes select any shape you
like. say ("Bevel") and place that in your worksheet.

--Right click the shapeAssign Macro and select the macro to be assigned

--Now try Button click


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default to run a command in a cell

Check out this

http://www.youtube.com/watch?v=cbDbA83DbhI

Sub Macro1()
Range("A1") = Now
End Sub

=NOW() is a formula. The above macro will insert the current date and time
to cell A1. If you are looking to insert a formula try

Sub Macro1()
Range("A1") = "=NOW()"
End Sub


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Did all but doesn't work. I use Excel 2007 is your solution also for this
version ?

The command to have the system date&time is =now()

must it be the same your code ?

"Jacob Skaria" wrote:

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook.

Sub Macro1()
Range("A1") = Now
End Sub

--From ToolbarsDrawingToolbarAutoShapesBasic Shapes select any shape you
like. say ("Bevel") and place that in your worksheet.

--Right click the shapeAssign Macro and select the macro to be assigned

--Now try Button click


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default to run a command in a cell

Try

Sub Macro1()
Activecell = now
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hi again ;-)

it does work but it changes the field A1 but i want it to a cell that i want.
I click f.e. on A47 and click the button and then date&time appears in A47

"Steven Van Laethem" wrote:

Did all but doesn't work. I use Excel 2007 is your solution also for this
version ?

The command to have the system date&time is =now()

must it be the same your code ?

"Jacob Skaria" wrote:

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook.

Sub Macro1()
Range("A1") = Now
End Sub

--From ToolbarsDrawingToolbarAutoShapesBasic Shapes select any shape you
like. say ("Bevel") and place that in your worksheet.

--Right click the shapeAssign Macro and select the macro to be assigned

--Now try Button click


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default to run a command in a cell

That is working ! You are great.

Any chance that i can introduce that in a single cell

So i click A47 and that the date&time comes automatically

"Jacob Skaria" wrote:

Try

Sub Macro1()
Activecell = now
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hi again ;-)

it does work but it changes the field A1 but i want it to a cell that i want.
I click f.e. on A47 and click the button and then date&time appears in A47

"Steven Van Laethem" wrote:

Did all but doesn't work. I use Excel 2007 is your solution also for this
version ?

The command to have the system date&time is =now()

must it be the same your code ?

"Jacob Skaria" wrote:

Set the Security level to low/medium in (Tools|Macro|Security). From workbook
launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the
below code. Save. Get back to Workbook.

Sub Macro1()
Range("A1") = Now
End Sub

--From ToolbarsDrawingToolbarAutoShapesBasic Shapes select any shape you
like. say ("Bevel") and place that in your worksheet.

--Right click the shapeAssign Macro and select the macro to be assigned

--Now try Button click


If this post helps click Yes
---------------
Jacob Skaria


"Steven Van Laethem" wrote:

Hello,

I want to run a command -- =Now()
in a cell.

I want it configured as a button ( in a cell) so when i press that
button/cell that automaticayly it takes the system date and tim.

Who can help me ?

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
how to run a command from a cell Seede Excel Worksheet Functions 2 March 15th 09 08:04 AM
Pivot Table Error Message - "Command Text not set for command obje Jeff Divian Excel Discussion (Misc queries) 0 November 7th 07 10:26 PM
Locate a cell, based on a criteria, then use the 'Cell' command... cdavidson Excel Discussion (Misc queries) 1 November 17th 05 06:30 PM
in vba what command is used to determine if a particular cell on a particular sheet changed? some kind of event? how to get the old and new value of the cell? Daniel Excel Worksheet Functions 1 June 23rd 05 07:53 PM
VBA Command to Look at cell in an If statement Wolf New Users to Excel 3 December 27th 04 11:27 PM


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