ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Error 2023 (https://www.excelbanter.com/new-users-excel/450015-error-2023-a.html)

KarateB

Error 2023
 
Ok new user here so be gentle :)

Long story short, Im working with a excel database for a karate studio that was designed by someone who is no longer with us. I am trying to run an action that creates and prints labels and when i do I get a run time error. The following is what shows up when i debug. If more info is needed let me know, this database contains some sensitive info so I'm trying to be careful of what I post.

x.Selection.TypeParagraph

' Change font back so it is not red for rest of label
x.Selection.Font.ColorIndex = wdBlack
x.Selection.Font.Name = "Courier New"

'*
'* Format Phone Info
'*
x.Selection.Font.Bold = wdToggle
x.Selection.TypeText Text:="Phones: "
x.Selection.Font.Bold = wdToggle
If (DadCellPhone < "") And (MomCellPhone < "") Then
x.Selection.TypeText Text:=Left("Mc-" & MomCellPhone & " Dc-" & DadCellPhone, 33)

ElseIf (DadCellPhone = "") And (MomCellPhone < "") Then
x.Selection.TypeText Text:=Left("Mc-" & MomCellPhone & " H-" & Homephone, 33)

ElseIf (DadCellPhone < "") And (MomCellPhone = "") Then
x.Selection.TypeText Text:=Left("Dc-" & DadCellPhone & " H-" & Homephone, 33)

ElseIf (DadCellPhone = "") And (MomCellPhone = "") And (DadWorkphone < "") Then
x.Selection.TypeText Text:=Left("H-" & Homephone & " Dw-" & DadWorkphone, 33)

ElseIf (DadCellPhone = "") And (MomCellPhone = "") And (MomWorkPhone < "") Then
x.Selection.TypeText Text:=Left("H-" & Homephone & " Mw-" & MomWorkPhone, 33)

End If


The line " If (DadCellPhone < "") And (MomCellPhone < "") Then
x.Selection.TypeText Text:=Left("Mc-" & MomCellPhone & " Dc-" & DadCellPhone, 33)" is highlighted yellow and gives a refrence error but Im not sure how to go about fixing it. Any help is greatly appreciated. If you need more info please let me know. Thanks again everyone!


All times are GMT +1. The time now is 06:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com