Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a macro that does the following, it deletes all the data within the
spreadsheet, imports 2 files and then saves the spreasheet. This macro works fine but when filters have been used within the spreadsheet and i come to run the macro the spreadsheet freezes on me everytime. Even if i clear all the filters the error still appears. To work around it i have to remove the filters, exit and save the spreasheet and then re-open it. The Macro then works ok again. Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
as ALWAYS, post your code for comments
-- Don Guillett SalesAid Software "davemel" wrote in message ... I have a macro that does the following, it deletes all the data within the spreadsheet, imports 2 files and then saves the spreasheet. This macro works fine but when filters have been used within the spreadsheet and i come to run the macro the spreadsheet freezes on me everytime. Even if i clear all the filters the error still appears. To work around it i have to remove the filters, exit and save the spreasheet and then re-open it. The Macro then works ok again. Thanks |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
The code is below, Thanks
Sub Qualityimport() ' ' Qualityimport Macro ' Macro recorded 24/07/2006 by COATESD ' ' Application.Goto Reference:="R2C1" With Selection.QueryTable .Connection = "TEXT;K:\Mfgpro\datefile.txt" .TextFilePlatform = xlWindows .TextFileStartRow = 1 .TextFileParseType = xlFixedWidth .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = True .TextFileSemicolonDelimiter = False .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 1, 1) .TextFileFixedColumnWidths = Array(8, 10) .Refresh BackgroundQuery:=False End With Application.Goto Reference:="R4C1" Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Selection.ClearContents Application.Goto Reference:="R4C1" With Selection.QueryTable .Connection = "TEXT;K:\Mfgpro\qextract.prn" .TextFilePlatform = xlWindows .TextFileStartRow = 1 .TextFileParseType = xlDelimited .TextFileTextQualifier = xlTextQualifierDoubleQuote .TextFileConsecutiveDelimiter = False .TextFileTabDelimiter = False .TextFileSemicolonDelimiter = True .TextFileCommaDelimiter = False .TextFileSpaceDelimiter = False .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) .Refresh BackgroundQuery:=False End With Range("A4,C:C").Select Range("C1").Activate ActiveWindow.SmallScroll ToRight:=2 Range("A4,C:C,G:G,I:I,J:J").Select Range("J1").Activate Columns("G:G").EntireColumn.AutoFit Columns("I:I").ColumnWidth = 10.57 Columns("J:J").ColumnWidth = 7 Columns("C:C").ColumnWidth = 10.14 Columns("C:C").EntireColumn.AutoFit Range("H1").Select ActiveWorkbook.Save Range("C1").Select End Sub "Don Guillett" wrote: as ALWAYS, post your code for comments -- Don Guillett SalesAid Software "davemel" wrote in message ... I have a macro that does the following, it deletes all the data within the spreadsheet, imports 2 files and then saves the spreasheet. This macro works fine but when filters have been used within the spreadsheet and i come to run the macro the spreadsheet freezes on me everytime. Even if i clear all the filters the error still appears. To work around it i have to remove the filters, exit and save the spreasheet and then re-open it. The Macro then works ok again. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
link to combobox | Excel Discussion (Misc queries) | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Running filters using a macro | Excel Worksheet Functions | |||
macro with F9 | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) |