Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
I have no idea why this is giving me a error: Windows(dataFile).Activate
I am coverting a Excel 97 spreadsheet to work with a new computer with
Excel 2003 installed, I am having some problems with querying collected statistics to the data report file, I am getting the following error. I am getting a "Run-time error '13' Type mismatch Sub addStatsToDataFile() 'adds the collected statistics (max and min right now) to the data report file Dim x As Integer Dim localResult As Variant Application.StatusBar = "Adding statistical data in " & dataFile Windows(dataFile).Activate ' THIS IS WHAT IS HIGHLIGHTED WHEN I COMPILE Application.ScreenUpdating = False Selection.Name = "home" 'the current cell should be the last cell (serial number column) Selection.Formula = "max:" stepRight 1 For x = 1 To numberOfTests localResult = scaleStr(maxValue(x)) Selection.Formula = localResult stepRight 1 If x 1 And x Mod 10 = 1 Then 'vertical page break after 10 columns... Selection.Formula = "max:" stepRight 1 End If Next x Range("home").Select stepDown 1 Selection.Formula = "min:" stepRight 1 For x = 1 To numberOfTests localResult = scaleStr(minValue(x)) Selection.Formula = localResult stepRight 1 If x 1 And x Mod 10 = 1 Then 'vertical page break after 10 columns... Selection.Formula = "min:" stepRight 1 End If Next x Range("home").Select End Sub I am new to using VBA for Excel but I am a quick study, I need to pick up where the last sys admin left off. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
I have no idea why this is giving me a error: Windows(dataFile).Ac
replace the line
Windows(dataFile).Activate with Workbook(datafile).Activate "madlinux" wrote: I am coverting a Excel 97 spreadsheet to work with a new computer with Excel 2003 installed, I am having some problems with querying collected statistics to the data report file, I am getting the following error. I am getting a "Run-time error '13' Type mismatch Sub addStatsToDataFile() 'adds the collected statistics (max and min right now) to the data report file Dim x As Integer Dim localResult As Variant Application.StatusBar = "Adding statistical data in " & dataFile Windows(dataFile).Activate ' THIS IS WHAT IS HIGHLIGHTED WHEN I COMPILE Application.ScreenUpdating = False Selection.Name = "home" 'the current cell should be the last cell (serial number column) Selection.Formula = "max:" stepRight 1 For x = 1 To numberOfTests localResult = scaleStr(maxValue(x)) Selection.Formula = localResult stepRight 1 If x 1 And x Mod 10 = 1 Then 'vertical page break after 10 columns... Selection.Formula = "max:" stepRight 1 End If Next x Range("home").Select stepDown 1 Selection.Formula = "min:" stepRight 1 For x = 1 To numberOfTests localResult = scaleStr(minValue(x)) Selection.Formula = localResult stepRight 1 If x 1 And x Mod 10 = 1 Then 'vertical page break after 10 columns... Selection.Formula = "min:" stepRight 1 End If Next x Range("home").Select End Sub I am new to using VBA for Excel but I am a quick study, I need to pick up where the last sys admin left off. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Any idea why this is giving me a #Value! Error? | Excel Worksheet Functions | |||
VLOOKUP returning a #VALUE! error and I've not idea why! HELP!!! | Excel Worksheet Functions | |||
overflow error 6.. the macro just stops any idea why? | Excel Programming | |||
Reference to a variable in windows(???).Activate | Excel Programming | |||
using array with Windows().activate | Excel Programming |