Solved

Range of boject-worksheet failed

Posted on 2013-10-22
4
148 Views
Last Modified: 2013-10-22
Folks,
In the below code at the very first line I am getting this error:
Method 'Range of Object_worksheet failed.
Private Sub cmdCheckTDT_Click()
If Range(A8).Text = "Football game: Tyle vs Winston starts 16.10.2013 exactly at 16:00 !!" Then
    Range("A7").Locked = False
    Range("A7").Font.Color = vbWhite
    Range("A7").Interior.Color = vbRed
    Range("A7").Value = "Correct"
    
Else
    Range("A7").Value = "Error"
    Range("A7").Font.Color = vbYellow
    Range("A7").Interior.Color = vbBlack
    Range("A7").Locked = True
    CheckFormulaFunction
    Exit Sub
End If
FormulasOK

End Sub

Open in new window

Here's the code in A8:
=B4 & " starts " & TEXT(B5,"DD.MM.YYYY") & " exactly at " & TEXT(B6,"hh:mm") & " !!"

Open in new window


I'm simply trying to pull what's in A8 to what should be in A8 and that determines what happens next.
0
Comment
Question by:Frank Freese
  • 3
4 Comments
 
LVL 19

Accepted Solution

by:
Ken Butters earned 500 total points
Comment Utility
try putting A8 in double quotes.

If that doesn't work you may need to more explicity identify the range you are referring to...

example : thisWorkbook.sheets("Sheet1").Range("A8")
0
 

Author Comment

by:Frank Freese
Comment Utility
OK folks - I think I foundthe error of my ways
Range(A8) needs to be Range ("A8")
0
 

Author Comment

by:Frank Freese
Comment Utility
I've requested that this question be deleted for the following reason:

Saw what I did wrong and resolved it myself
0
 

Author Closing Comment

by:Frank Freese
Comment Utility
thanks - I came to the same conclusion
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now