Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default How to tell a user no range has been selected.

hi
that would depend on what you call selecting. i assume that you want more
than 1 cell selected.....so.....
If Selection.Cells.Count = 1 Then
MsgBox("you have selected only 1 cell. need more. process terminated.")
Exit Sub
End If
Selection.CopyPicture...etc..etc

you may have to decide how much is enough?????
i see a some gray here ie what is "entire area".
regards
FSt1


"StargateFan" wrote:

I selected an area on the screen and then did a record macro. Here's
what I obtained as a script:

Sub CopyQuotefallToBitmap()
'
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
End Sub

Is there a way for Excel to detect when no range has been selected and
to advise the user they need to select a range (always starting at B4,
though entire area after that can differ somewhat) and then the script
can proceed to the rest of the "Selection.CopyPicture..." scripts
above after that?

Thanks! :oD


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default How to tell a user no range has been selected.

I selected an area on the screen and then did a record macro. Here's
what I obtained as a script:

Sub CopyQuotefallToBitmap()
'
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
End Sub

Is there a way for Excel to detect when no range has been selected and
to advise the user they need to select a range (always starting at B4,
though entire area after that can differ somewhat) and then the script
can proceed to the rest of the "Selection.CopyPicture..." scripts
above after that?

Thanks! :oD

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default How to tell a user no range has been selected.

if typename(selection) < "Range" Then Msgbox "Select Range"

"StargateFan" wrote in message
...
|I selected an area on the screen and then did a record macro. Here's
| what I obtained as a script:
|
| Sub CopyQuotefallToBitmap()
| '
| Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
| End Sub
|
| Is there a way for Excel to detect when no range has been selected and
| to advise the user they need to select a range (always starting at B4,
| though entire area after that can differ somewhat) and then the script
| can proceed to the rest of the "Selection.CopyPicture..." scripts
| above after that?
|
| Thanks! :oD
|

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default How to tell a user no range has been selected.

On Mon, 3 Aug 2009 20:48:01 -0700, FSt1
wrote:

hi
that would depend on what you call selecting. i assume that you want more
than 1 cell selected.....so.....
If Selection.Cells.Count = 1 Then
MsgBox("you have selected only 1 cell. need more. process terminated.")
Exit Sub
End If
Selection.CopyPicture...etc..etc

you may have to decide how much is enough?????
i see a some gray here ie what is "entire area".
regards
FSt1


Yeah, that'll work. As long as not just the active cell is selected
that should be enough.

Thanks. I'll give it a try.

"StargateFan" wrote:

I selected an area on the screen and then did a record macro. Here's
what I obtained as a script:

Sub CopyQuotefallToBitmap()
'
Selection.CopyPicture Appearance:=xlScreen, Format:=xlPicture
End Sub

Is there a way for Excel to detect when no range has been selected and
to advise the user they need to select a range (always starting at B4,
though entire area after that can differ somewhat) and then the script
can proceed to the rest of the "Selection.CopyPicture..." scripts
above after that?

Thanks! :oD



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
How to: User selected range? Phil Smith Excel Programming 7 December 19th 08 08:41 PM
Get user selected range into RefEdit J. Hall Excel Programming 2 April 9th 04 05:05 PM
Referring to a user-selected range James Mc Excel Programming 2 January 27th 04 07:46 AM
Identify User Selected Range RonF Excel Programming 3 January 12th 04 04:36 PM
Identify Range Selected By User RonF Excel Programming 1 January 9th 04 05:29 PM


All times are GMT +1. The time now is 03:23 AM.

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

About Us

"It's about Microsoft Excel"