LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Macro still wont run

Thanks Jim Thomlinson for supplying this code for me.
However, now I get "Expected Function or Variable" on the OpenText part

Dim bk As Workbook, rng As Range
ChDir "C:\Temp"
Set bk = Workbooks.OpenText(Filename:="C:\Temp\myfile.txt", _
Origin:=xlWindows, _
StartRow:=1, _
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), _
Array(8, 1), Array(12, 1), Array(17, 1), _
Array(21, 1), Array(29, 1), Array(38, 1), _
Array(46, 1), Array(50, 1), Array(58, 1), _
Array(67, 1))) 'Missing last bracket
Set rng = ActiveSheet.Range("A1").CurrentRegion
Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1)
Windows("daily.xls").Activate
Sheets("table").Select
Worksheets("table").Unprotect
rng.Copy Destination:=Range("T2")

What am I missing now?
Thanks!

 
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
Keep getting error, wont run macro! HELP! Myles Excel Discussion (Misc queries) 2 March 30th 09 03:58 PM
Date format from excel to CVS file wont. Change in CVS wont stay. Fish''s Mermaid Excel Worksheet Functions 1 October 14th 06 12:28 AM
Macro wont run! Joe Excel Discussion (Misc queries) 9 January 17th 06 07:01 PM
Macro that wont go away - Help taxmom Excel Worksheet Functions 3 April 13th 05 06:39 PM
Help, Macro wont run from a particular worksheet Joel Mills Excel Programming 3 December 30th 04 05:47 PM


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