Results 1 to 5 of 5

convert a single-celll range to a cell

Threaded View

  1. #1
    Registered User
    Join Date
    10-10-2003
    Posts
    31

    convert a single-celll range to a cell

    The code below generates a type mismatch error as shown. I think it's because 'Target' is a single-cell range, not a cell proper, so 'Target.Value' fails but I don't know how to convert the range to a cell. Help appreciated.

    Private Sub Worksheet_Change(ByVal Target As Range)
    	If Intersect(Target, Range("InputRange")) Is Nothing Then
    		Exit Sub  'the cell that changed isn't in the range we're concerned with
    	ElseIf Target.Value = "" Then                                                                         '<------ type mismatch error here
    		Target.Value = Target.Offset(0, 3).Value    're-assert the default value
    	End If
    End Sub
    Thanks - Jim

    Moderators Note: Please follow Forum Rule #3 and use code tags. Added this time, but please use them in the future…Thanks.
    Last edited by jeffreybrown; 12-28-2012 at 03:35 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1