PDA

View Full Version : Challenging macro



keilah
09-06-2007, 01:26 AM
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....

mdmackillop
09-06-2007, 02:43 AM
Always happy to "assist".
Can you post the macro as you have developed it?

keilah
09-06-2007, 02:58 AM
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....

mdmackillop
09-06-2007, 04:32 AM
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 (http://www.vbaexpress.com/forum/faq.php?faq=new_faq_item#faq_posthelp_faq_item)
Regards
MD

keilah
09-06-2007, 04:52 AM
hi....NOT ASKING FOR FREE.............

keilah
09-06-2007, 05:11 AM
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....

mdmackillop
09-07-2007, 10:17 AM
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