Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2012, 02:08 PM
coxjamd coxjamd is offline Stop macro "IF" Windows XP Stop macro "IF" Office 2010 32bit
Novice
Stop macro "IF"
 
Join Date: Jan 2012
Posts: 6
coxjamd is on a distinguished road
Default Stop macro "IF"

I am using an Insert Row macro from "Gary L Brown 2001" but trying to prevent the macro from executing if the Active Cell is in the spreadsheet header.



What I am looking for is a statement that:

if the Active Cell is above (A6) then end.

Any suggestions??
Reply With Quote
  #2  
Old 03-01-2012, 02:19 PM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Stop macro "IF" Windows 7 32bit Stop macro "IF" Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

How about something like this:
Code:
If ActiveCell.Row < 6 Then
    Exit Sub
End If
Reply With Quote
  #3  
Old 03-01-2012, 02:40 PM
coxjamd coxjamd is offline Stop macro &quot;IF&quot; Windows XP Stop macro &quot;IF&quot; Office 2010 32bit
Novice
Stop macro &quot;IF&quot;
 
Join Date: Jan 2012
Posts: 6
coxjamd is on a distinguished road
Default

Thanks, this is exactly what I was looking for!

I guessed all around it.

The macro (attached to an object) now inserts rows (user specified number) below the active cell (now excluding the header) and then fills in the formulas allowing for a one click update to "grow" the number of rows as needed.

I don't see a way to mark this solved - but it is.
Reply With Quote
Reply

Tags
activecell, excel 2010, macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop macro &quot;IF&quot; Macro to print "Current Page" in Word 2010 Jshopping Word VBA 10 06-08-2012 01:15 AM
Stop macro &quot;IF&quot; How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM
Stop macro &quot;IF&quot; Launch macro sub after hitting "create pdf" button in word webharvest Word VBA 1 06-29-2011 04:56 PM
Can I stop the right click "move here" feature? BillAnderson PowerPoint 0 04-16-2011 02:42 PM
How to stop "replace"'ing new words (in desperate need of advice) bme081 Word 6 11-02-2009 05:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft