+ Reply to Thread
Results 1 to 1 of 1

macro to insert row, copy cells and keep hidden columns

  1. #1
    Registered User
    Join Date
    09-26-2005
    Posts
    7

    macro to insert row, copy cells and keep hidden columns

    I wrote a macro for users to insert a row below with some (not all) copied cell formulas from above ... the user has to highlight any cell in the row above where they want the insert and then press a button that I have assiciated to the macro ... my macro works except when I have hidden columns (which I do to keep the view simple) ...

    I could add a section to pre unhide columns (and then rehide to keep the view) but I will then lose my active cell pointer (I use this to make sure I insert the row in the right place) ... any ideas ??? ... I thought I could create a field to hold the activecell reference and then go back to it once I unhide the columns but have been unable to figure out how to do this ... the other answer is to understand why the hidden columns are creating a problem ...

    Thanks in advance ...

    Steve

    No reponse yet team !!! ... any help out there ??? ... here is the code I was referencing ...

    Private Sub InsertRisk_Click()
    ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
    Selection.Insert Shift:=xlDown
    ActiveCell.Offset(-1, 0).Rows("1:1").EntireRow.Select
    Selection.Copy
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveSheet.Paste
    Application.CutCopyMode = False

    ActiveCell.Range("b1:e1").Select
    Selection.ClearContents
    ActiveCell.Offset(0, -1).Range("A1").Select

    ActiveCell.Range("m1:w1").Select
    Selection.ClearContents
    ActiveCell.Offset(0, -12).Range("A1").Select

    ActiveCell.Range("y1:y1").Select
    Selection.ClearContents
    ActiveCell.Offset(0, -24).Range("A1").Select

    End Sub
    Last edited by steven_thomas; 09-27-2005 at 11:51 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1