Vishesh- Need Macro help

Hello Vishesh,

I am attaching three sample files. I want to build a macro to be run from “Sample 3” which is resulting file. After clicking run it should ask user to enter month name as “July ’10" and after considering this input from user it should add to “Sample 2” sheets from A to A July '10 and so on .. and then merge “Sample 1” & “Sample 2” file in “Sample 3”. It should move as first A JULY '09 then A JULY '10 and for next A JULY ’11 similarly for B and so on …

In short the resulting sheet would be “Sheet 3” with the exact sheets order.

Please help.

Thanks.

Bunty

AttachmentSize
Sample 1.xls13.5 KB
Sample 2.xls13.5 KB
Sample 3.xls20 KB
Vishesh's picture

For solution, pls visit url:

For solution, pls visit url: http://excelexperts.com/solution-forum-ques

macros

I entered a date 01/05/2009 in "a1" cell and
entered another date 01/08/2010 in "b1" cell

Formula to be copied from a2 to down in colmun:A = date(year(a1),month(a1)+1,1)

I have to write a macro to copy down the formula a2 to down in the column A until the ActiveCell.value = "$B$1"

kindly help me in this problem

deekshituluchs@gmail.com

Vishesh's picture

Range("A2:A1000").FillDown Ch

Range("A2:A1000").FillDown

Change the range accordingly.

Macros

I entered a date 01/05/2009 in "a1" cell and
entered another date 01/08/2010 in "b1" cell

Formula to be copied from a2 to down in colmun:A = date(year(a1),month(a1)+1,1)

I have to write a macro to copy down the formula a2 to down in the column A until the ActiveCell.value = "$B$1"

kindly help me in this problem

for above purpose I wrote different codes like below but even one not working properly kindly see the code below:

Public Sub mydate()
If ActiveCell.Cells(2, 1) = Cells(1, 2) Then
ActiveCell.Vaue = ""
Else
ActiveCell.FormulaR1C1 = "=DATE(YEAR(Cells(2,1)),MONTH(Cells(2,1))+1,1)"
ActiveCell.Offset(1, 0).Select
End If
End Sub

'Do While ActiveCell.Cells(2, 1) = ActiveCell.Cells(1, 2)
'ActiveCell.FormulaR1C1 = "=DATE(YEAR(Cells(2,1)),MONTH(Cells(2,1))+1,1)"
'Loop

'Do
'ActiveCell.FormulaR1C1 = "=IF(R[-1]C)=(R[-1]C[1])),"",DATE(YEAR(R[-1]C),MONTH(R[-1]C)+1,1))"
'ActiveCell.Offset(1, 0).Select
'Loop Until IsEmpty(ActiveCell.Offset(1, 0))

'Do While ActiveCell.Cells(2, 1) = ActiveCell.Cells(1, 2)
'ActiveCell.FormulaR1C1 = "=DATE(YEAR(R[-1]C),MONTH(R[-1]C)+1,1)"
'ActiveCell.Offset(1, 0).Select
'Loop

'If ActiveCell.Value = Cells(1, 2) Then End
'Else
'ActiveCell.FormulaR1C1 = "=DATE(YEAR(R[-1]C),MONTH(R[-1]C)+1,1)"

'Do
' ActiveCell.FormulaR1C1 = "=DATE(YEAR(R[-1]C),MONTH(R[-1]C)+1,1)"
' ActiveCell.Offset(1, 0).Select
'Loop Until ActiveCell.Offset(1, 0).Value = Cells(1, 2)
'End Sub