Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to select cells without a certain value and select a menu it

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to select cells without a certain value and select a menu it

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro to select cells without a certain value and select a menu it

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro to select cells without a certain value and select a menu it

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to select cells without a certain value and select a men

Hi Gord,
I am just a novice at this and can't figure out how the formula works.
It selects all cells on the entire sheet that do not have "Bye" and I can't
figure out how to get it to just select all cells in a range (E2 thru E17 for
this one) that do not have "Bye".

Happy New Year!
Guy

"Gord Dibben" wrote:

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to select cells without a certain value and select a men

Additional Info.
All cells in the range have some value and are not empty.

"Guy" wrote:

Hi Gord,
I am just a novice at this and can't figure out how the formula works.
It selects all cells on the entire sheet that do not have "Bye" and I can't
figure out how to get it to just select all cells in a range (E2 thru E17 for
this one) that do not have "Bye".

Happy New Year!
Guy

"Gord Dibben" wrote:

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro to select cells without a certain value and select a men

Change this line...............For Each Cell In ActiveSheet.UsedRange

to this..............For Each Cell In ActiveSheet.Range("E2:E17")

BTW this is not a formula. It is VBA macro code.


Gord

On Thu, 1 Jan 2009 14:28:01 -0800, Guy
wrote:

Hi Gord,
I am just a novice at this and can't figure out how the formula works.
It selects all cells on the entire sheet that do not have "Bye" and I can't
figure out how to get it to just select all cells in a range (E2 thru E17 for
this one) that do not have "Bye".

Happy New Year!
Guy

"Gord Dibben" wrote:

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro to select cells without a certain value and select a men

That's OK


Gord

On Thu, 1 Jan 2009 14:31:00 -0800, Guy
wrote:

Additional Info.
All cells in the range have some value and are not empty.

"Guy" wrote:

Hi Gord,
I am just a novice at this and can't figure out how the formula works.
It selects all cells on the entire sheet that do not have "Bye" and I can't
figure out how to get it to just select all cells in a range (E2 thru E17 for
this one) that do not have "Bye".

Happy New Year!
Guy

"Gord Dibben" wrote:

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy



  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to select cells without a certain value and select a men

Thanks a bunch Gord, the 'VBA Macro code' works great. I'm learning. :)

Happy New Year,
Guy

"Gord Dibben" wrote:

Change this line...............For Each Cell In ActiveSheet.UsedRange

to this..............For Each Cell In ActiveSheet.Range("E2:E17")

BTW this is not a formula. It is VBA macro code.


Gord

On Thu, 1 Jan 2009 14:28:01 -0800, Guy
wrote:

Hi Gord,
I am just a novice at this and can't figure out how the formula works.
It selects all cells on the entire sheet that do not have "Bye" and I can't
figure out how to get it to just select all cells in a range (E2 thru E17 for
this one) that do not have "Bye".

Happy New Year!
Guy

"Gord Dibben" wrote:

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy




  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Macro to select cells without a certain value and select a men

Good to hear.

I'm just learning too.

The original code came from Bob Flanagan for highlighting locked or unlocked
cells on a sheet.

I just modified for your case.


Gord

On Thu, 1 Jan 2009 19:15:01 -0800, Guy
wrote:

Thanks a bunch Gord, the 'VBA Macro code' works great. I'm learning. :)

Happy New Year,
Guy

"Gord Dibben" wrote:

Change this line...............For Each Cell In ActiveSheet.UsedRange

to this..............For Each Cell In ActiveSheet.Range("E2:E17")

BTW this is not a formula. It is VBA macro code.


Gord

On Thu, 1 Jan 2009 14:28:01 -0800, Guy
wrote:

Hi Gord,
I am just a novice at this and can't figure out how the formula works.
It selects all cells on the entire sheet that do not have "Bye" and I can't
figure out how to get it to just select all cells in a range (E2 thru E17 for
this one) that do not have "Bye".

Happy New Year!
Guy

"Gord Dibben" wrote:

You actually do not have to select tempR

With tempR
'do some stuff
End With


Gord

On Wed, 31 Dec 2008 12:07:10 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Sub Find_Cells()

Dim Cell As Range, tempR As Range
For Each Cell In ActiveSheet.UsedRange
'edit the range to suit or just Selection
If Cell.Value < "Bye" Then
If tempR Is Nothing Then
Set tempR = Cell
Else
Set tempR = Union(tempR, Cell)
End If
End If
Next Cell
If tempR Is Nothing Then
MsgBox "There are no cells " & _
"in the selected range."
End
End If

tempR.Select
End Sub


Gord Dibben MS Excel MVP

On Wed, 31 Dec 2008 09:42:19 -0800, Guy
wrote:

I have been trying to get a "IF" macro to work for this but am having trouble
figuring out how to select just the cells without value "Bye". Can someone
please help.

Thanks,
Guy

"Guy" wrote:

I need a way to auto select all cells within a particular range that do not
have a certain value, (Bye), and if possible to also select a custom menu
function. The menu function is a 'random sort' feature that I have on my menu
bar and I wish to select a certain feature under the dropdown menu (random
sort selected cells) with this macro. I would like to have a macro to do both
with one click but just the macro to auto select all cells within the range
without value (Bye) will do.

Thanks,
Guy





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
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
need a macro select all cells in a worksheet? MarkN Excel Discussion (Misc queries) 0 June 23rd 06 12:47 AM
Want macro to select & copy cells from a different worksheet RocketRod Excel Discussion (Misc queries) 5 February 28th 06 12:53 PM
how do you "select locked cells" w/o "select unlocked cells"? princejohnpaulfin Excel Discussion (Misc queries) 3 July 16th 05 03:53 AM
How do I pause a macro to select specific cells lee Excel Worksheet Functions 1 April 2nd 05 02:11 PM


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

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"