Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate the sheet with date

I have a userform which takes input from user like start date and en
date.once I have those I want to find the difference and fill the star
date in A1 and A2 with next day, go on till I reach end date how do I d
that?

format of the date 08/06/2004


Code
-------------------
Sheet3.Activate
Range("B1").Select
ActiveCell.Value = frmCalendar.txtCalendar.Value
Do

ActiveCell.Offset(0, 1).Select
ActiveCell.Value = frmCalendar.txtCalendar.nextDay

Loop Until (ActiveCell.Value = frmCalendar1.txtCalendar1.Value
-------------------


If I do That it gives error type mismatch erro

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Populate the sheet with date

Hi Patty,

Sheet3.Activate

nowDate = frmCalendar.txtCalendar.Value

i=1
Do
With Cells( i,1)
.Value = nowDate
.numberformat = "m/dd/yyyy")
End With
nowDate = nowDate + 1
i = i + 1
Loop Until nowDate frmCalendar1.txtCalendar1.Value


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Patty2005 " wrote in message
...
I have a userform which takes input from user like start date and end
date.once I have those I want to find the difference and fill the start
date in A1 and A2 with next day, go on till I reach end date how do I do
that?

format of the date 08/06/2004


Code:
--------------------
Sheet3.Activate
Range("B1").Select
ActiveCell.Value = frmCalendar.txtCalendar.Value
Do

ActiveCell.Offset(0, 1).Select
ActiveCell.Value = frmCalendar.txtCalendar.nextDay

Loop Until (ActiveCell.Value = frmCalendar1.txtCalendar1.Value)
--------------------


If I do That it gives error type mismatch error


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate the sheet with date

,

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate the sheet with date



--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populate the sheet with date

for some reason the code didn't work.it's not filling the values in th
worksheet.so I modified your code a little bit and made it t
work.Thanks for the help


Code
-------------------
Sheet3.Activate
Sheet3.Range("B1").Select
nowDate = frmCalendar.txtCalendar.Value
i = 1
Do
Do
If IsEmpty(ActiveCell) = False Then
ActiveCell.Offset(0, 1).Select
End If
Loop Until (IsEmpty(ActiveCell) = True)
ActiveCell.Value = nowDate
ActiveCell.NumberFormat = "mm/dd/yyyy"
nowDate = nowDate + 1
i = i + 1
Loop Until nowDate = frmCalendar1.txtCalendar1.Valu
-------------------


--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to lookup date on tab in excel and populate date on calen MGC Excel Worksheet Functions 0 February 4th 10 04:48 AM
Populate excel sheet based on values in a separate sheet Andi Excel Discussion (Misc queries) 3 September 17th 09 02:53 PM
Populate order sheet with data from work sheet Veronica Johnson Excel Worksheet Functions 4 January 22nd 08 03:29 AM
How to populate prices in sheet two based on cost in sheet one dstooch Excel Worksheet Functions 0 April 3rd 06 10:56 PM
Best way to extract data on one sheet & populate it on another sheet?????? WebWizard97 Excel Programming 1 September 25th 03 08:50 PM


All times are GMT +1. The time now is 12:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"