LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Yo Yo is offline
external usenet poster
 
Posts: 3
Default Help... This code consistently crashes for no reason.

I am not sure if posting code is a faux pas, but it is a really simple one.
Even though it crashes everytime I run it...Why?
Thanks in advance,
Yo.

Sub explainLocations()
Dim wbL As Workbook, wbT As Workbook
Dim wsT As Worksheet, wsL As Worksheet
Dim rT As Range, rE As Range, rW As Range
Dim rC As Range, rL As Range
Dim swb As String

Set wbL = Workbooks(ActiveWorkbook.Name)
Set wsL = Worksheets(wbL.ActiveSheet.Name)
Set rL = wsL.Range("B1", Range("B1").End(xlToRight).Address(0, 0))

For Each rC In rL.Cells
Set rW = Range(c.Address(0, 0))
swb = "C:\Documents and Settings\Me\Desktop\Web\" & wsL.Name & "\" &
rC.Value
Set wbT = Workbooks.Open(swb)
Set wsT = Worksheets(wbT.ActiveSheet.Name)
Set rT = wsT.Range("A1", Range("B1000").End(xlUp).Address(0, 0))
For Each rE In rT.Cells
If rE.Font.Underline = "2" Then
Set rW = rW.Offset(1, 0)
rW.Value = rE.Value
End If
Next
Set wsT = Nothing
Set rT = Nothing
wbT.Close
Set wbT = Nothing
Next
Set rW = Nothing
End Sub


 
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
Vlookup not working consistently Julie B. Excel Worksheet Functions 3 June 4th 08 01:27 AM
How do I get filtering to behave consistently? Steve Excel Worksheet Functions 0 April 25th 07 11:50 AM
Code crashes after clearing comments L. Howard Kittle Excel Worksheet Functions 2 February 20th 06 04:54 AM
CPU Usage consistently above 75% hparteep Excel Discussion (Misc queries) 1 October 27th 05 02:56 PM
Code in ThisWorkbook crashes Excel Pat Beck Excel Programming 6 August 25th 03 09:07 AM


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