Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Thanks Bernie

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Thanks Bernie

I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Thanks Bernie

is the code you pasted your actual code from your workbook or Bernie's code
from yesterday ... if its Bernie's code, check that the line prior to the
error line on your code has a
space underscore
at the end of it
if that's not the problem and this is Bernie's code, could you please copy &
paste your code.

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Jodi" wrote in message
...
I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Thanks Bernie

Jodi,

You probably have formulas in row 10 rather than constants. Try changing
that row to

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeFormulas)


Also, if you have a mix of formulas and constants, then you could change

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then

to

For Each myCell In _
Intersect(Range("10:10"), ActiveSheet.UsedRange)
If myCell.Value < "" And myCell.Value < "DOG" Then

HTH,
Bernie
MS Excel MVP


"Jodi" wrote in message
...
I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Thanks Bernie

As copied from my workbook with different rows referenced....

Sub Consolidate()

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook


With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set mybook = Workbooks.Open(.FoundFiles(i))
mybook.Worksheets("Daily!").Select
For Each myCell In _
Range("4:4").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(328, 0).Value
End If
Next myCell
mybook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub

Thanks!


"JulieD" wrote:

is the code you pasted your actual code from your workbook or Bernie's code
from yesterday ... if its Bernie's code, check that the line prior to the
error line on your code has a
space underscore
at the end of it
if that's not the problem and this is Bernie's code, could you please copy &
paste your code.

--
Cheers
JulieD
check out www.hcts.net.au/tipsandtricks.htm
....well i'm working on it anyway
"Jodi" wrote in message
...
I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Thanks Bernie

Ive tried both alternative and am still getting 1004
:-\

"Bernie Deitrick" wrote:

Jodi,

You probably have formulas in row 10 rather than constants. Try changing
that row to

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeFormulas)


Also, if you have a mix of formulas and constants, then you could change

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then

to

For Each myCell In _
Intersect(Range("10:10"), ActiveSheet.UsedRange)
If myCell.Value < "" And myCell.Value < "DOG" Then

HTH,
Bernie
MS Excel MVP


"Jodi" wrote in message
...
I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Thanks Bernie

:-\ indeed.

Send me a sample workbook, and I'll take a look. Remove the space and
change the dot to .

HTH,
Bernie
MS Excel MVP


"Jodi" wrote in message
...
Ive tried both alternative and am still getting 1004
:-\

"Bernie Deitrick" wrote:

Jodi,

You probably have formulas in row 10 rather than constants. Try

changing
that row to

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeFormulas)


Also, if you have a mix of formulas and constants, then you could change

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then

to

For Each myCell In _
Intersect(Range("10:10"), ActiveSheet.UsedRange)
If myCell.Value < "" And myCell.Value < "DOG" Then

HTH,
Bernie
MS Excel MVP


"Jodi" wrote in message
...
I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?






  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Thanks Bernie

How about if there is a formula in row 7?

"Bernie Deitrick" wrote:

Jodi,

You probably have formulas in row 10 rather than constants. Try changing
that row to

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeFormulas)


Also, if you have a mix of formulas and constants, then you could change

For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then

to

For Each myCell In _
Intersect(Range("10:10"), ActiveSheet.UsedRange)
If myCell.Value < "" And myCell.Value < "DOG" Then

HTH,
Bernie
MS Excel MVP


"Jodi" wrote in message
...
I did add option explicit and declared additional variables

Dim myCell As Range
Dim Basebook As Workbook
Dim i As Integer
Dim mybook As Workbook

But I am still getting error

Thanks!

"Jodi" wrote:

Code graciously provided by Bernie Deitrick yesterday .....

Sub Consolidate()

Dim myCell As Range

With Application
.DisplayAlerts = False
.EnableEvents = False
.ScreenUpdating = False
End With

With Application.FileSearch
.NewSearch
'Copy or move this workbook to the folder with
'the files that you want to summarize
.LookIn = ThisWorkbook.Path
.FileType = msoFileTypeExcelWorkbooks
If .Execute() 0 Then
Set Basebook = ThisWorkbook
For i = 1 To .FoundFiles.Count
If .FoundFiles(i) < ThisWorkbook.FullName Then
Set myBook = Workbooks.Open(.FoundFiles(i))
myBook.Worksheets("Daily!").Select
For Each myCell In _
Range("10:10").SpecialCells(xlCellTypeConstants)
If myCell.Value < "DOG" Then
ThisWorkbook.Worksheets(1). _
Range("A65536").End(xlUp)(2).Value = _
myCell.Offset(-3, 0).Value
End If
Next myCell
myBook.Close
End If
Next i
End If
End With

With Application
.DisplayAlerts = True
.EnableEvents = True
.ScreenUpdating = True
End With

Basebook.SaveAs Application.GetSaveAsFilename

End Sub


Im getting Rune Time Error 1004 on this line

Range("10:10").SpecialCells(xlCellTypeConstants)
Any ideas why?




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
Calling Bernie Deitrick Hile Excel Worksheet Functions 4 August 27th 08 08:37 PM
Bernie Deitrick CBrausa Excel Discussion (Misc queries) 1 May 5th 06 10:27 PM
Bernie My New Macro JulianB Excel Worksheet Functions 1 March 8th 05 09:41 PM
My New Macro from Bernie JulianB Excel Worksheet Functions 1 March 4th 05 05:21 PM
Bernie Deitrick Trying to excel in life but need help Excel Worksheet Functions 1 January 19th 05 03:27 PM


All times are GMT +1. The time now is 05:48 AM.

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"