Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default create a macro that opens, edits then closes cell

I want to create a macro that opens a cell, allows me to edit the cell (with
a pause for input) then close the cell and go down 4 lines. I come from a
Lotus background where I could just make the formula, give it a shortcut key
and perform the task
(<f2<home<rightIF($AG$<pause=,,<en ter<down<down<down<end)

Starting cell contents
=IF($AG$26="W",$AE$26,$AE27)

Ending cell contents after running macro
=IF($AG$24="","",IF($AG$24="W",$AE$24,$AE25))

Some help would be great

Dale Saunders

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default create a macro that opens, edits then closes cell

VBA does not lend itself to pauses for input directly to the worksheet and
then continue with the macro. You can, however, use an InputBox feature or
a contol such as a TextBox to make input to cells on the worksheet while the
macro is running. Below is a brief example of how an input box would work.
Copy this code to your public code module, Alt + F11, and test it. If the
code window is dark, on the VBE menu bar, select InsertModule, then paste
the code into it. To run the code from Excel, click ToolsMacroMacros then
select the macro name and click run.

Sub testInput()
'Some code here
Range("A5") = Application.InputBox("Enter a Formula", "INPUT
FORMULA", Type:=0)
Range("A9") = Application.InputBox("Enter a Formula", "INPUT
FORMULA", Type:=0)
'Other code here
End Sub

When entering a formula in the input box, use absolute reference, i.e. $A$1,
or you could create circular references, since the cell references would
otherwise be relative to the cell in which the formula is entered.


"Dale Saunders" <Dale wrote in message
...
I want to create a macro that opens a cell, allows me to edit the cell
(with
a pause for input) then close the cell and go down 4 lines. I come from a
Lotus background where I could just make the formula, give it a shortcut
key
and perform the task
(<f2<home<rightIF($AG$<pause="","",<enter<dow n<down<down<end)

Starting cell contents
=IF($AG$26="W",$AE$26,$AE27)

Ending cell contents after running macro
=IF($AG$24="","",IF($AG$24="W",$AE$24,$AE25))

Some help would be great

Dale Saunders



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
Hyperlink to pdf opens and closes Barbara Excel Discussion (Misc queries) 2 September 18th 12 09:07 PM
excel Visual basic opens then closes for users steve Excel Discussion (Misc queries) 0 March 3rd 10 05:15 PM
File opens another file runs macro and closes Steven Excel Programming 2 July 3rd 08 04:45 AM
I want to create a macro that opens the Find Box on the sheet Ken Excel Programming 2 November 30th 07 04:41 PM
Creating a .bat file that opens, pauses & closes MS Excel alexa Excel Programming 15 August 22nd 05 08:58 PM


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