Home |
Search |
Today's Posts |
#6
![]() |
|||
|
|||
![]()
Hi Excel 2000,
Selection.find ...." is highligted with yellow color in my VB Editor. Your macro includes a number of such lines. If the search string, e.g. a left bracket character '(', is not found, you will encounter a run-time error. Perhaps easiest would be for you to respond with the following information: (1) Give examples of the initial data (2) Show the desired final format (3) Give the location of the data to be converted. --- Regards, Norman "Excel 2000 Macros debugger" wrote in message ... I am trying to format US phone numbers for my database so that the telephone number column should have the local phone numbers following the country code and also a leading zero. "Selection.find ...." is highligted with yellow color in my VB Editor. The error that VB is throwing is Sub Tel() ' ' Tel Macro ' Macro recorded 10/24/2005 by madhu ' ' Keyboard Shortcut: Ctrl+t ' Range("A1").Select Cells.Find(What:="tele", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Cells.Find(What:="telephone", After:=ActiveCell, LookIn:=xlFormulas, _ LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False).Activate Columns("L:L").Select Selection.Find(What:="(", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Selection.Replace What:="(", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False ActiveCell.Replace What:=")", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=")", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate ActiveCell.Replace What:=")", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=")", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate ActiveCell.Replace What:=")", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=")", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate ActiveCell.Replace What:=")", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=")", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate ActiveCell.Replace What:=")", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=")", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Selection.Replace What:=")", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=" ", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Selection.FindNext(After:=ActiveCell).Activate Selection.FindNext(After:=ActiveCell).Activate Selection.FindNext(After:=ActiveCell).Activate Selection.FindNext(After:=ActiveCell).Activate Selection.FindNext(After:=ActiveCell).Activate Selection.FindNext(After:=ActiveCell).Activate ActiveCell.Replace What:=" ", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False Selection.Find(What:=" ", After:=ActiveCell, LookIn:=xlFormulas, LookAt _ :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _ False).Activate Selection.Replace What:=" ", Replacement:="", LookAt:=xlPart, _ SearchOrder:=xlByRows, MatchCase:=False With Selection .HorizontalAlignment = xlLeft .VerticalAlignment = xlBottom .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .MergeCells = False End With ActiveWindow.SmallScroll Down:=-90 Range("M10").Select Selection.EntireColumn.Insert Range("M11").Select ActiveCell.FormulaR1C1 = "=CONCATENATE(0, RC[-1])" Range("M11").Select Selection.AutoFill Destination:=Range("M11:M308"), Type:=xlFillDefault Range("M11:M308").Select Range("M298").Select ActiveWindow.SmallScroll Down:=-6 Range("M297").Select ActiveWindow.LargeScroll Down:=-1 Range("M263").Select ActiveWindow.LargeScroll Down:=-1 Range("M229").Select ActiveWindow.LargeScroll Down:=-1 Range("M195").Select ActiveWindow.LargeScroll Down:=-1 Range("M161").Select ActiveWindow.LargeScroll Down:=-1 Range("M127").Select ActiveWindow.LargeScroll Down:=-1 Range("M93").Select ActiveWindow.LargeScroll Down:=-1 Range("M59").Select ActiveWindow.LargeScroll Down:=-1 Range("M11").Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Range("L11").Select Range("L11").Select Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False Range("M11").Select Application.CutCopyMode = False Columns("M:M").Select Selection.Delete Shift:=xlToLeft Range("L12").Select End Sub "Norman Jones" wrote: Hi Excel 2000 Macros debugger, You would need to post your code, the error encountered and the line highlighted when the error occurs. --- Regards, Norman "Excel 2000 Macros debugger" <Excel 2000 Macros wrote in message ... I am working on Excel 2000 macros and am frequently getting debug errors, although I notice no mistakes when creating the macros. Somebody please help !! Thanks, m. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I lock info in Excel 2003 and users in Excel 2000 enter info? | Excel Discussion (Misc queries) | |||
Hyperlink in Excel 2000 can't open bookmarked Word 2000 file | Excel Discussion (Misc queries) | |||
Excel XP 2002 Vs. Excel 2000 | Excel Discussion (Misc queries) | |||
i want to connect excel with sql server 2000 as database with macr | Excel Discussion (Misc queries) | |||
Excel 2000 to Excel 2002 problem | Excel Discussion (Misc queries) |