Consulting

Results 1 to 7 of 7

Thread: Challenging macro

  1. #1
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location

    Challenging macro

    Hi
    I need assistance with a macro that well copy and paste "exact copy of formulas".........condition that the cursor has to be placed in the row that will be copied

    Here is the question: say i have date in row 69 and column G (staring point)

    I need a macro that will do the following steps:

    1. Insert two rows below row 69 column G (this is were the cursor willbe placed) or a msg box indicate were to add the two rows from......

    2. the first row that is added to format row height "fixd" to 9

    3. second row stay the normal height

    4. in the second row copy and paste all the forumla from row 69 into it.

    5. the ability to repeat the steps - once the next end of month comes up...

    6. copy all formulas from row 9 column G to last column....

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Always happy to "assist".
    Can you post the macro as you have developed it?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  3. #3
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    i have not even given it some thought on how to got about it............

    still playing around with another macro......

    i was wondering if the gurus on this forum could help....

  4. #4
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Keilah,
    You're using words such as "assist" and "help", but what you're saying is, "Will someone create this code for me for free?" We expect questioners to do some work for themselves. See our FAQ
    Regards
    MD
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    hi....NOT ASKING FOR FREE.............

  6. #6
    VBAX Contributor
    Joined
    Aug 2007
    Posts
    165
    Location
    Sub copyover()
    Dim ad As Range
    Set ad = ActiveCell
    Dim row, NewRow As Integer

    Application.ScreenUpdating = False

    row = 9.Row

    Cells(1, row).Formula
    Cells(1, row + 2).EntireRow.Insert Shift:=xldown
    Cells(1, row).EntireRow.Copy

    Cells(1, col + 1).Select
    ActiveSheet.Paste

    Application.ScreenUpdating = True

    End Sub

    Hi MD

    this is how far i have got........i and now there are mistakes ....... still learning....

  7. #7
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    [VBA]Option Explicit

    Sub NewMonth()
    Dim c As Range
    Set c = Cells(Rows.Count, 7).End(xlUp)
    c.Offset(-1, -6).Resize(2, 1).EntireRow.Copy
    c.Offset(1, -6).Insert Shift:=xlDown
    c.Offset(2) = DateAdd("m", 2, DateSerial(Year(c), Month(c), 1)) - 1
    Application.CutCopyMode = False
    End Sub[/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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