From: terilad on 25 Feb 2010 09:21 Hi, I am looking for a formula or code to fill in a range of cells with a figure on the 1st of every month, so when 1st March arrives I need cell C1 to enter £100 and when 1st April arrives I need cell D2 to £100 and so on for 12 months. Can anyone help me with this query. Many thanks Mark
From: Jacob Skaria on 25 Feb 2010 09:29 Select the sheet tab which you want to work with. Right click the sheet tab and click on 'View Code'. This will launch VBE. Paste the below code to the right blank portion. Get back to to workbook and try out. Private Sub Worksheet_Activate() If Day(Date) = 1 Then Cells(1, Month(Date)) = 100 End Sub -- Jacob "terilad" wrote: > Hi, > > I am looking for a formula or code to fill in a range of cells with a figure > on the 1st of every month, so when 1st March arrives I need cell C1 to enter > £100 and when 1st April arrives I need cell D2 to £100 and so on for 12 > months. > > Can anyone help me with this query. > > Many thanks > > > Mark
From: terilad on 25 Feb 2010 09:39 Hi Jacob, This code not doing anything for me, do I have to input cells into the code so that the cells C1, D1, E1 etc fill in withh the 100 on the ist of every month? Many thanks Mark "Jacob Skaria" wrote: > Select the sheet tab which you want to work with. Right click the sheet tab > and click on 'View Code'. This will launch VBE. Paste the below code to the > right blank portion. Get back to to workbook and try out. > > > Private Sub Worksheet_Activate() > If Day(Date) = 1 Then Cells(1, Month(Date)) = 100 > End Sub > > -- > Jacob > > > "terilad" wrote: > > > Hi, > > > > I am looking for a formula or code to fill in a range of cells with a figure > > on the 1st of every month, so when 1st March arrives I need cell C1 to enter > > £100 and when 1st April arrives I need cell D2 to £100 and so on for 12 > > months. > > > > Can anyone help me with this query. > > > > Many thanks > > > > > > Mark
|
Pages: 1 Prev: Can you write VBA to export objects Next: Rounding 2 decimal Places |