#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default HELP!

I'm trying to write a macro to look at dates and print each different date to
another sheet in another workbook. I'm not that great with vb code so I need
some help. Here's what I have.

Dim str As Workbook
Dim mon As Workbook

Workbooks.OpenText Filename:="C:\Documents and
Settings\lahall\Desktop\monthly"

Set str = Workbooks("Scrap Trend Report experiment.xls")
Set mon = Workbooks("monthly.xls")

For L = 1 To 2000
'This is the line that comes up in the debug'
If str.Worksheets("data").Cells(1, L) <
str.Worksheets("data").Cells(1, L + 1) Then
For B = 1 To 5
str.Worksheets("data").Cells(1, L).Copy
Destination:=mon.Worksheets("sheet2").Cells(1, B)
Next B
End If
Next L

Thanks,
Lacy
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



All times are GMT +1. The time now is 12:37 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"