Find Method Version 2000 Vs 2003

Mar 20, 2007

I have a Find Method routine in a procedure that works fine in xl2000, but fails in xl2003 with error code 9, subscript out of range.

Is there a different format for the Find Method in xl2003?

'code in xl2000

Dim CourseI As Range 'Students taking BusinessI
Dim CourseII As Range 'Students taking BusinessII
Dim BothCoursesTrue As Range
Dim Student As Range

'code
'code ...

For Each Student In CourseI
Set BothCoursesTrue = CourseII.Find(Student, LookIn:=xlValue, LookAt:=xlWhole)
If Not BothCoursesTrue Is Nothing Then Student.Offset(, 3) = 3
Next Student

View 8 Replies


ADVERTISEMENT

Differences With Find Method In 2000 And 2002

Jun 15, 2007

I am using the following code which works in microsoft 2002, but not in 2000. When I run it in 2000 it says " Named argument not found." The debugger highlights the line Set C through delete.

Sub DeleteRows()
Dim c As Range

With Worksheets("Sheet1").Range("A1", Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp))
Do
Set c = . Find(What:=" ", After:=[A1], LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not c Is Nothing Then c.Resize(12).EntireRow.Delete
Loop While Not c Is Nothing
End With
End Sub

View 7 Replies View Related

SaveAs Method Working In Both 2002 & 2000

Sep 19, 2007

We're gradually moving over to Excel 2007 (from 2002) at my workplace.

My problem is that I need to run macros on both versions but I'm having trouble with the SaveAs method.

I have Excel 2007 set to save automatically in Excel 97-2003 File Format but this doesn't seem to apply to files saved using VBA.

My original 2002 code is as follows:

Workbooks.Add
ActiveWorkbook.SaveAs Filename:="C:ReportsNewFile.xls"
and 2007
Workbooks.Add
ActiveWorkbook.SaveAs Filename:="C:ReportsNewFile.xls", FileFormat:=xlExcel8

How can I get it to switch depending on the version it's run on? Unfortunately Excel 2002 doesn't recognise '=xlExcel8' so I don't think I can use an If/Else statement on the version number.

View 10 Replies View Related

Copy Method Of Range Class Failed 2000

Jul 8, 2006

I encounter error 1004 and copy method of range class failed in this VB routine:

fltPreviousValue = Range(varPreviousCell).Value
fltCurrentValue = Range(varCurrentCell).Value
fltNextValue = Range(varNextCell).Value

Range(varCurrentCell).Activate

If fltCurrentValue = RangeMax(ActiveCell.Offset(-2, 0), ActiveCell.Offset(2, 0)) And _
Range(varPreviousCell).Value < Range(varCurrentCell).Value And _
Range(varCurrentCell).Value >= Range(varNextCell).Value Then
Range(varCurrentCell).Select
Selection.Copy (ActiveCell.Offset(0, 6))

I am using Excel 2000 and the error occured at the last command, the bolded one.

View 9 Replies View Related

#NAME (2000 OK 2003 NO)

Nov 23, 2006

Excel 2000 spreadsheet everything is fine.

When I open the same file in excel 2003 #NAME? Error appears.

I check Accept Labels in Formulas and it helped in some places but not everywhere.

I still have lots of NAME errors in a relatively simple spreadsheet.

I Excel 2000 everything works fine.

View 9 Replies View Related

Version 97 IF Formula Not Recognized In 2003

Nov 17, 2006

The following simple formula was written in Excel version 97. when I try to use it on a newer version (03) it does not seem to recognise it as a formula? =IF(F66="yes",1,IF(F66="N/A",1,0))

View 2 Replies View Related

UDF Compatibility Between 2003 & 2000

Aug 17, 2006

I have an activity recording tool created in Excel 2003 which works perfectly (ish)
However when some of my colleagues use it on machines running Excel 2000 it falls over at the following definition

Dim dlgFile As FileDialog

this is part of the following sub routine

Sub doCopy()
Application.ScreenUpdating = False
Call Archive
Dim dlgFile As FileDialog
Dim rv As Long
Dim sCreated As String
Dim sClosed As String
Dim wsThis As Worksheet
Dim wbkAOM As Workbook
Dim sThisCol As String
Dim aAOMCol As String
Dim strDate As String
Dim wsCore As Worksheet
Dim wsDiverted As Worksheet
Dim iRow As Integer
Set wsThis = Application. ActiveWorkbook.ActiveSheet
Set dlgFile = Application.FileDialog(msoFileDialogFilePicker)
dlgFile.Title = "Select AOM Sheet"
dlgFile.InitialFileName = "*.xls"
rv = dlgFile.Show.......................

View 5 Replies View Related

Version Coding Conflict XL 2007 Vs. 2003

Dec 3, 2009

With the kind help of this forum, I put together a nice business tool that has a fair amount of automation via macro buttons, etc. It works great in XL 2007 but some users are having issues in 2003. I appreciate this is quite general but are there significant conflicts / differences with coding in these two different versions?

View 6 Replies View Related

Default To 2003 Instead Of 2007 Beta Version

Oct 20, 2006

i installed office 2007 beta version on my computer (for testing)
together with the already existing office 2003.
now the default program of my excel files is excel
2007 beta version (not excel 2003).
can i change this behavior so that when i open an excel file the
default program would be excel 2003 instead of excel 2007
and whenever i want to open a file using excel 2007 i do
so by right clicking the file & choosing excel 2007 from the
open with list.

View 5 Replies View Related

Macro Works In 97 & 2000 But Not 2003

Mar 15, 2007

I convert text file into Excel. Then what I want is to look in column C for cell value “UNT:” (it is chopped word account: ) and copy value what is in the same row next column D into column K.

Then in column K copy down the value until next not empty cell.

My problem is that it works on Excel 97 and 200 but 2003 doesn’t work.

View 9 Replies View Related

Macro In 2003 Is Not Working In 2000

Apr 25, 2008

I have constructed a macro, (with lots of help from the fine people on this site), and have distributed it to several people in the company. The macro was written in Excel 2003, and runs perfectly on all the machines running Excel 2003, but persons using Excel 2000 are getting a runtime error, variable not defined.

Is there a trick to getting a macro to run in both versions of Excel?

View 9 Replies View Related

Macro Run Faster In 2000 Than 2003

Feb 18, 2008

I have a macro which is able to run very fast in Excel 2000. Almost 5s. When i run it in Excel 2003, it takes almost 4 to 5 mins to complete. Is there any patch in 2003 i need to run the macro smoothly?

View 4 Replies View Related

Need To Know Version(2003/2007) True Macro Code.

Sep 29, 2009

I need to find out which version of excel i am using in macro.I mean whether it is 2003 or 2007.Because i need to put 2 diff codes according to the version of excel.Can any one please provide me the macro code to findout the version of Excel.

View 9 Replies View Related

Filter Locked Worksheet Conflict - 2000 Vrs. 2003

Feb 1, 2007

I recently launched a model that uses filtering on protected worksheets. The model was developed in Excel 2000, and everything works perfectly for the users who are also on 2000, but my Excel 2003 users get an error on opening the workbook.

The error asks for the password to unlock the sheet and is difficult to clear. Users have to hit Cancel 8 times to clear the error, at which point, the model appears to function perfectly. (There are 12 worksheets in the model, 2 with filters, all locked and password protected.)

The follwoing code is in the 'ThisWorkbook' module:

Private Sub Workbook_Open()
With Worksheets("Initiatives")
.Protect DrawingObjects:=True, contents:=True, userInterfaceOnly:=True
.EnableAutoFilter = True
.Protect contents:=True, userInterfaceOnly:=True
End With

Because the error occurs when first opening the model but not at other times, I'm thinking that there's something in the Workbook_Open procedure that is causing the error.

View 9 Replies View Related

Run A Macro On My Machine (Windows 2000 And Office 2003)

Jun 29, 2006

I'm trying to run a macro on my machine (Windows 2000 and Office 2003) and I keep getting an error on one method. Now I tried to run the same macro on a different machine (Windows XP and Office 2003) and it didn't error out.

Public strControlTitle As String
Public strControlTime As String
Public strControlUnit As String
Public intControlItem As Integer
Public intLastNameOnly As Integer
Public intDataType As Integer


Sub Main()
Dim strControlItem, strPageName, strValue, sigma, z95, z99 As String
Dim r, c, count, cmax, rmax, rt, ct, low, high, a, b As Integer
Dim lesscol As Integer
With ControlChartForm
.ComboBox1.AddItem ("Average Turn Around Time All Patients")....................

View 4 Replies View Related

2000/2003 Formula Compatibility: The Formulas Fields Do Not Populate Data Just #N/A

Apr 24, 2007

When I open an excel 2000 spreadsheet in 2003, the formulas fields do not populate data just #N/A. I can see data just fine in Excel 2003 viewer.

View 5 Replies View Related

Find An Average In 2000

Jun 2, 2009

I have a total in F16 that i need to find an average of.

The range is set from f4 - f15 (12 months) and need to find the running average per month. but as we only have done 5 months of the year so far that is the only average required (F16/5).

I need this to count at the end of june (F16/6) basically not counting any zero months (jul, aug, sept etc until the end of each)

View 5 Replies View Related

Excel 2000 :: Find Duplicates Then Calculating Dates?

Aug 28, 2013

I record all jobs that come into my department. Column A contains the Job reference. Column B Contains the date that the job arrived and Column C contains the date that the job was complete.

The job can be split into several sections and can arrive on different days and the sections can be completed in different days.

I am looking to create a table that will show how long the complete job took to complete, so I am looking for the earliest date and the latest date for specific job reference numbers.

An example of my data is:

Column A Column B Column C
Ref No Date In Date Out
2013-0055 01/03/2013 25/03/2013
2013-0061 01/03/2013 03/03/2013
2013-0061 02/03/2013 20/03/2013
2013-0055 07/03/2013 28/03/2013
2013-0061 08/03/2013 19/03/2013

From the above data I am looking to create a table that will show

Ref No First Date Last Date Number of Days
2013-0055 01/03/2013 28/03/2013 28
2013-0061 01/03/2013 20/03/2013 20

I am using Excel 2000.

View 4 Replies View Related

Excel 2003 :: Runtime Error 438 - Object Doesn't Support This Property Or Method

Nov 1, 2012

I am using Excel 2003. I get the above error and when I press debug, the issue highlighted is the following:

Code:

graff:
adde.TextBox6.Text = "ok"
shet = ActiveSheet.Name
Set CurrentChart = ActiveSheet.ChartObjects.Add(5, 20, 350, 200)

[Code].....

View 6 Replies View Related

Find Format: Find Method And Combine It With A Countif Or Loop

Feb 20, 2007

I'm trying to use this Find Method and combine it with a countif or loop. Something that will count a number of occurences of a unique type of character. I'm looking to find all "F" characters in Bold, Italic and Size 16. Here's my find code that I'm trying to use. I can get it to work by itself but not along with a countif or loop.

Sub count_4()
Dim r As Range
Set r = Range("A1:A6")
With Application.FindFormat.Font
.Bold = True
.Italic = True
.Size = 16
End With
r.Find(What:="F", LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, searchformat:=True, MatchCase:=True).Activate
End Sub

View 4 Replies View Related

Find Method To Find Nth Occurence

Jul 17, 2007

Private Sub cmdShowdata_Click()
Dim Tgt As Worksheet
Dim Source As Range
Dim wbSource As Workbook
Dim cel As Range
Dim rng As Range
Dim c As Range
Dim i As Long
Application. ScreenUpdating = False
Set Tgt = ActiveSheet
Set wbSource = Workbooks.Open("C:Documents and SettingsDesktopStaff Recoed 2")
Set Source = wbSource.Sheets(1).Columns(1)
With Tgt
.Activate
'clear old data
Range(.Cells(3, 2), .Cells(200, 5)).ClearContents
' Loop through names in column A
For Each cel In Range(.Cells(3, 1), .Cells(Rows.Count, 1).End(xlUp))
If Not cel = "" Then...................

The above vba command which is extract the data from the Other workbooks. It looks for the "Staff 001", "Staff 002"...these parameters to transfer the data to the worksheet. But, the "Staff 001" data must appear twice in each workbooks. If i use the above command, i only can extract the FIRST "Staff 001" average data. But SECOND "Staff 001" average data cannot extract. I know it may be use FindNext method to do this but i am not sure how to write it

View 5 Replies View Related

Find Method On One Row Only

Jul 13, 2009

Is there a way to use the find method on 1 row only?

View 2 Replies View Related

Find Method Returning Value?

Aug 27, 2007

I know I must be missing something basic, but why is this code assigning a value to "NamePosition", instead of a range:

RightName = Sheets("WorkingSheet").Cells(1, 1).Value

Sheets("Tracker").Activate
Set StudentTbl = Sheets("Tracker").Range("A1:" & "Z" & NumStudents)

Set NamePosition = StudentTbl.Find(What:=RightName, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
I thought the find method returned a range?

View 6 Replies View Related

Return Value From Find Method

Aug 13, 2006

I am having trouble using teh find method. I'm using it to search for a string in a column, then give me the row number, which is fine when the string is found, but when it is not I get an error of "variable not set." I'm pretty certain it is returning void, but how to I capture that? Here's the

voucher_row = Worksheets("Table").Columns("D:D").Find(voucher, LookIn:=xlValues, LookAt:=xlWhole).Row

"voucher" is a string.

View 3 Replies View Related

Find Method When No Match

Nov 8, 2006

I am going through various excel sheets looking for certain text on them. not all of the sheets will have the text.

I have been using

Cells. Find(What:="FindMe", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate

and it works fine, if the text is on the sheet. When the text is not on the sheet, how should I handle this.

I have tried On Error and IsError variations, but could use a little guidance

View 4 Replies View Related

Find Method Not Returning Value

Sep 21, 2007

The objective of this macro is to sort through a database and find all entries that match up (ie 12345 and -12345) and delete these records. when i run it foundCell always returns nothing.


Sub recSheet()
Dim balance As Double
Dim balanceCell As Double
Dim BalanceVal As Variant
Dim FoundVal As Double
Dim calcmode As Long
Dim ViewMode As Long
Dim FoundCell As Object
Dim myRng As Range
Dim sh As Worksheet

With Application
calcmode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
Set sh = ActiveSheet
Set myRng = sh.Range("I:I")
With sh
.Select .................................

View 9 Replies View Related

Macro To Find A Word In A Sentence By Using The "FIND" Method

Dec 14, 2008

giving me a macro to find a word in a sentence by using the "FIND" method.
For example I have a sentence say "I am happy" in which I have to search whether any of 2 words say "Happy" or "Sad" is there or not. If the sentence contains any of these words, then that row has to be highlighted.

View 9 Replies View Related

Insert Value On Clipboard Into Find Method

Jan 31, 2013

How to get the GetFromClipboard syntax from here working with my code (below), but am having a really frustrating time. Basically, I need to search for whatever value is copied to the clipboard (as you can see below which will be relative to a certain cell).

Here's what I have so far, and I'm trying to replace the contents of the What:="121212121" part of the Find method to look for the clipboard contents (a 9 char number) in another sheet (where a duplicate exists - the value I am searching will be a unique identifier for the incorrectly created duplicate record that needs to be deleted).

So, What:=<insert number/string on clipboard here>

VB:
Sub DeleteDupes()

ActiveCell.Offset(0, 5).Range("A1").Select
Selection.Copy
Sheets("ActvMbrs_MatchCombos").Select
Cells.Find(What:="121212121", After:=ActiveCell, LookIn:=xlFormulas, _

[Code] .....

View 2 Replies View Related

Using Find Method To Match Dates

Dec 2, 2009

I am trying to use the .Find method to match a date. In sheet2 I have a range of cells which are formatted to only show the day "dd" (I could format each cell to show (dd-mmm-yy, etc). In sheet1, I have dates which are formatted as "January 7, 2009"

I want to create a VBA find routine which allows me to match the date from Sheet2 (Ranged between cells A1:Z1) with Sheet1. Then output a MsgBox stating "Match found in cell $A$7 of Sheet1" I have tried a formula similar to:

PHP Set FoundCell = Sheets("Sheet1").Range("A1:Z1").Find _
(what:=DateValue("January 7, 2009") ,lookin:=xlFormulas) 

View 5 Replies View Related

Find Method Only Returns 2nd Value In Cell

Mar 11, 2014

My .find function is only finding the 2nd value in a cell example If i look up the term " HOSE"

5/8 hose water Will return
5/8 heater hose will not

Basically what I am making is something I am calling a "what" button. It queries my database and returns all the part numbers with the term i put in and i thought it was working fine till i was testing it, did i do something to select this? I've tried xlpart and xl whole. Neither is working.

Here is the code below

Sub COPYPARTNUMBERINFO()Dim parttofind As String
Dim partcell As Range
Dim partref As Range
ActiveSheet.Unprotect Password:="*******"
Range("t6:T10000:u6:U10000").Select
Selection.ClearContents
parttofind = InputBox("What is the number or discription")

[code].....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved