LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Bob Phillips
 
Posts: n/a
Default Is it possible to insert a macro command in an "IF" function?

Hopefully I gave you all you need. Follow my directions and try it. Post
back then if you have problems.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"SandyLACA" wrote in message
...
Thank you Bob but this is beyond everyone here. I'll go to the help menu

and
look up event procedures and see where it leads me.


"Bob Phillips" wrote:

Sorry, didn't finish

A function cannot trigger a macro that changes the worksheet, such as
inserting a row. What you could do is check if the value changes to Yes,

and
use an event procedure to insert the row. For instance, assuming the

value
is in A use this code

Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit:
Application.EnableEvents = False
If Target.Column = 1 Then
If LCase(Target.Value) = "yes" Then
Target.EntireRow.Insert
End If
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--

HTH

RP
(remove nothere from the email address if mailing direct)


"SandyLACA" wrote in message
...
We would like to be able to set up an "IF" function where if the

answer is
yes a row will be inserted. This would seem to require a macro being
triggered but we don't know how to do that. If there is some other way

of
accomplishing that we would appreciate the help.
Thank you,








 
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
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Insert Row macro not working Acct Supr - DCTC Excel Discussion (Misc queries) 3 October 7th 05 01:11 AM
Insert A Row Macro Mark Williams New Users to Excel 2 September 30th 05 07:03 PM
Insert Row before Macro Button Kieranz Excel Discussion (Misc queries) 2 September 30th 05 01:57 PM
Help with macro looping and color query function kevinm Excel Discussion (Misc queries) 10 May 26th 05 01:25 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"