PC Review


Reply
Thread Tools Rate Thread

create a macro that opens, edits then closes cell

 
 
Dale Saunders
Guest
Posts: n/a
 
      23rd Mar 2010
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><right>IF($AG$<pause>=””,””,<enter><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

 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      23rd Mar 2010
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 Insert>Module, then paste
the code into it. To run the code from Excel, click Tools>Macro>Macros 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 (E-Mail Removed)> wrote in message
news:8A367137-4E4A-44FB-A33B-(E-Mail Removed)...
>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><right>IF($AG$<pause>="","",<enter><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
>



 
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
How to Create a Macro that opens a Dialog Box RKEvans Microsoft Word Document Management 3 23rd Sep 2008 12:45 AM
File opens another file runs macro and closes Steven Microsoft Excel Programming 2 3rd Jul 2008 04:45 AM
screen "jumps" when macro opens/closes forms =?Utf-8?B?S2F0aHk=?= Microsoft Access Macros 11 16th Jul 2006 09:11 PM
How can i create a macro button that opens a template? =?Utf-8?B?cm9i?= Microsoft Word Document Management 1 12th Jul 2005 12:24 AM
Create macro that changes the folder Word opens =?Utf-8?B?Um9ubmkgQmFja2Vy?= Microsoft Word Document Management 2 10th Feb 2005 07:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:30 AM.