Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Type Mismatch...

Roedd <<Darin Kramer wedi ysgrifennu:

Hi there,

I get a type mismatch error on the following line of code : "Set
objCell = Application.Selection" (see below)

Any idea why and how to fix ... (I swear it used to work!!!)

Thanks!!!!
D


Sub Reporting_Choice()

Dim objWS As Excel.Worksheet
Dim objCell As Excel.Range, objR As Excel.Range
Dim i As Byte
Dim J As Long

Set objWS = Sheets("Master")

Set objCell = Application.Selection


If your current selection is not a cell then of course this will raise an
error.

You need to ensure that a cell is selected:

If Typeof application.selection is Range then

<run your code
else
<display error message???

End if

HTH

Rob


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Type Mismatch: array or user defined type expected ExcelMonkey Excel Programming 4 July 6th 06 03:40 PM
Type mismatch using rnge as Range with Type 8 Input Box STEVE BELL Excel Programming 11 December 3rd 05 05:02 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
type mismatch here! J_J[_2_] Excel Programming 2 March 14th 05 03:14 PM
Type mismatch teresa Excel Programming 1 December 14th 04 11:19 PM


All times are GMT +1. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"