Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Can a macro write a macor

I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non blank
entries in that col or if the non entries were showiong,would show all the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Can a macro write a macor

What do you mean by "show"? I assume they are already showing.

--

Vasant

"PCOR" wrote in message
et.cable.rogers.com...
I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non blank
entries in that col or if the non entries were showiong,would show all the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Can a macro write a macor

I have a number of col and rows. Every row of every col does not necessarily
contain data
Example:
A B C D
1 12 9 45
2 3 54
3 22 78
4 112
5 100 14
6 25 65

Using the example above: If I placed my cursor at A1 and click a button I
want to see only rows1,2,5
If I was to press the button again(with the cursor at A1), then I would see
the entire col again.
I would like this process to continue as I add more data to col E,F etc
Thanks in advance


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
What do you mean by "show"? I assume they are already showing.

--

Vasant

"PCOR" wrote in message
et.cable.rogers.com...
I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non blank
entries in that col or if the non entries were showiong,would show all

the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Can a macro write a macor

Data | Filter | AutoFilter

should do what you want.

Not sure what this has to do with a macro writing a macro! :)

--

Vasant


"PCOR" wrote in message
et.cable.rogers.com...
I have a number of col and rows. Every row of every col does not

necessarily
contain data
Example:
A B C D
1 12 9 45
2 3 54
3 22 78
4 112
5 100 14
6 25 65

Using the example above: If I placed my cursor at A1 and click a button I
want to see only rows1,2,5
If I was to press the button again(with the cursor at A1), then I would

see
the entire col again.
I would like this process to continue as I add more data to col E,F etc
Thanks in advance


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
What do you mean by "show"? I assume they are already showing.

--

Vasant

"PCOR" wrote in message
et.cable.rogers.com...
I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non

blank
entries in that col or if the non entries were showiong,would show all

the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Can a macro write a macor

Intersect(Cells.SpecialCells(xlCellTypeBlanks),
ActiveCell.EntireColumn).EntireRow.Hidden = True

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"PCOR" wrote in message
et.cable.rogers.com...
I have a number of col and rows. Every row of every col does not

necessarily
contain data
Example:
A B C D
1 12 9 45
2 3 54
3 22 78
4 112
5 100 14
6 25 65

Using the example above: If I placed my cursor at A1 and click a button I
want to see only rows1,2,5
If I was to press the button again(with the cursor at A1), then I would

see
the entire col again.
I would like this process to continue as I add more data to col E,F etc
Thanks in advance


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
What do you mean by "show"? I assume they are already showing.

--

Vasant

"PCOR" wrote in message
et.cable.rogers.com...
I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non

blank
entries in that col or if the non entries were showiong,would show all

the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it










  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Can a macro write a macor

this seems to work:

Private Sub CommandButton1_Click()
call filterxxx (1)
End Sub

Private Function filterxxx(i As Integer)
Application.ScreenUpdating = False

If ActiveSheet.AutoFilterMode = False Then
Range("DATABASE").Select
With Selection
.AutoFilter Field:=i, Criteria1:="<"
End With
Else
ActiveSheet.AutoFilterMode = False
End If

Application.ScreenUpdating = True
End Function

this is assuming that the table of numbers is a named range called
"DATABASE".
The code for commandbutton1 will filter column 1 of DATABASE.You could
add another commandbutton at the top of column 2 and simply have:

Private Sub CommandButton2_Click()
call filterxxx (2)
End Sub

it should call the function but will filter using column2

Hope this is some help
Jason


"PCOR" wrote in message . net.cable.rogers.com...
I have a number of col and rows. Every row of every col does not necessarily
contain data
Example:
A B C D
1 12 9 45
2 3 54
3 22 78
4 112
5 100 14
6 25 65

Using the example above: If I placed my cursor at A1 and click a button I
want to see only rows1,2,5
If I was to press the button again(with the cursor at A1), then I would see
the entire col again.
I would like this process to continue as I add more data to col E,F etc
Thanks in advance


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
What do you mean by "show"? I assume they are already showing.

--

Vasant

"PCOR" wrote in message
et.cable.rogers.com...
I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non blank
entries in that col or if the non entries were showiong,would show all

the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Can a macro write a macor

Thanks for the efort Jason
How would you chnage this code to NOT have to name the col "DATABASE" but to
refer to the SELECTED COL
Thanks

"jason" wrote in message
om...
this seems to work:

Private Sub CommandButton1_Click()
call filterxxx (1)
End Sub

Private Function filterxxx(i As Integer)
Application.ScreenUpdating = False

If ActiveSheet.AutoFilterMode = False Then
Range("DATABASE").Select
With Selection
.AutoFilter Field:=i, Criteria1:="<"
End With
Else
ActiveSheet.AutoFilterMode = False
End If

Application.ScreenUpdating = True
End Function

this is assuming that the table of numbers is a named range called
"DATABASE".
The code for commandbutton1 will filter column 1 of DATABASE.You could
add another commandbutton at the top of column 2 and simply have:

Private Sub CommandButton2_Click()
call filterxxx (2)
End Sub

it should call the function but will filter using column2

Hope this is some help
Jason


"PCOR" wrote in message

. net.cable.rogers.com...
I have a number of col and rows. Every row of every col does not

necessarily
contain data
Example:
A B C D
1 12 9 45
2 3 54
3 22 78
4 112
5 100 14
6 25 65

Using the example above: If I placed my cursor at A1 and click a button

I
want to see only rows1,2,5
If I was to press the button again(with the cursor at A1), then I would

see
the entire col again.
I would like this process to continue as I add more data to col E,F etc
Thanks in advance


"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote in message
...
What do you mean by "show"? I assume they are already showing.

--

Vasant

"PCOR" wrote in message

et.cable.rogers.com...
I would love to have a macro do the following.
I would place my cursor at the top of a col and then press a button.
Pressing that button would do one of two things. Show all the non

blank
entries in that col or if the non entries were showiong,would show

all
the
entries in the selected col.
Can this be done
I would appreciate lots of help.
Thanks

--
Norton Professional 2004 says this email is clean...believe it






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
Help with Macor gsxith3 New Users to Excel 1 August 2nd 08 01:31 PM
Macor JakeShipley2008 Excel Discussion (Misc queries) 3 June 21st 07 04:40 PM
How to create a macor to count the usage of another macor Jigu Excel Discussion (Misc queries) 0 March 11th 06 03:28 AM
is it possible to execute write to the fields in another .xsl form a macro in another .xsl? e.g. some way to load another .xsl into an .xsl macro and write to its data? Daniel Excel Worksheet Functions 1 June 23rd 05 11:38 PM
end sub in If then macor P. Blaauw Excel Programming 3 September 20th 03 05:25 PM


All times are GMT +1. The time now is 08:53 AM.

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"