Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Update worksheet according to given user names.

Hello,

I have a worksheet 'SBL' with some data.
Headers in first row i.e. from A1 to K1.

In columnJ sarting from J2, I have some user names.
I have a defined name TUsers for all the user names in worksheet
Temp.

I want to remove all other rows in worksheet 'SBL', leaving behind
rows of TUsers only.


Any bright ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Update worksheet according to given user names.

if tusers is a single column or single row, you could add a helper column:

=ismatch(j2,tusers,0)
and copy down this helper column

It'll return True or false.

Then you could apply data|Filter|autofilter (xl2003 menus) to show just the rows
you want to delete.

Then delete those visible rows.

You may want to keep the rows, but just hide them with the autofilter????

Rambo wrote:

Hello,

I have a worksheet 'SBL' with some data.
Headers in first row i.e. from A1 to K1.

In columnJ sarting from J2, I have some user names.
I have a defined name TUsers for all the user names in worksheet
Temp.

I want to remove all other rows in worksheet 'SBL', leaving behind
rows of TUsers only.

Any bright ideas?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Update worksheet according to given user names.

Typo alert...

Use this instead.

=isnumber(match(j2,tusers,0))

Dave Peterson wrote:

if tusers is a single column or single row, you could add a helper column:

=ismatch(j2,tusers,0)
and copy down this helper column

It'll return True or false.

Then you could apply data|Filter|autofilter (xl2003 menus) to show just the rows
you want to delete.

Then delete those visible rows.

You may want to keep the rows, but just hide them with the autofilter????

Rambo wrote:

Hello,

I have a worksheet 'SBL' with some data.
Headers in first row i.e. from A1 to K1.

In columnJ sarting from J2, I have some user names.
I have a defined name TUsers for all the user names in worksheet
Temp.

I want to remove all other rows in worksheet 'SBL', leaving behind
rows of TUsers only.

Any bright ideas?


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default Update worksheet according to given user names.

This may get you started:

Sub Filter()
Dim LastRow As Long
Dim FirstRow As Long
Dim iRow As Long
Dim myArray As Variant

myArray = ThisWorkbook.Names("TUsers").RefersToRange.Value

FirstRow = 2
LastRow = Cells(Rows.Count, "J").End(xlUp).Row

For iRow = LastRow To FirstRow Step -1
If IsError(Application.Match(Cells(iRow, "J").Value, myArray, 0))
Then
Rows(iRow).Delete
Else
'do nothing
End If
Next iRow
End Sub

Run this with SBL the active sheet. It puts your named range of users into
an array. It then loops upward in SBL column K matching the cell against the
array. If it does not match the array that row is deleted, else if a match
the row is kept.

Mike F
"Rambo" wrote in message
...
Hello,

I have a worksheet 'SBL' with some data.
Headers in first row i.e. from A1 to K1.

In columnJ sarting from J2, I have some user names.
I have a defined name TUsers for all the user names in worksheet
Temp.

I want to remove all other rows in worksheet 'SBL', leaving behind
rows of TUsers only.


Any bright ideas?



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 the Excel generic worksheet names instead of user-given names in code Paul Excel Discussion (Misc queries) 5 June 26th 09 08:44 PM
MAKE A LIST OF NAMES FROM REPEATED NAMES IN THE SAME WORKSHEET r.kordahi Excel Discussion (Misc queries) 2 January 3rd 09 08:10 AM
Update worksheet - Based on user IDs list Sinner Excel Programming 1 March 23rd 08 04:17 AM
how to copy workbook names and worksheet names to columns in acces gokop Excel Programming 4 August 27th 07 11:26 AM
return all worksheet tab names and chart sheet tab names in report - an example DataFreakFromUtah Excel Programming 2 October 6th 04 08:09 PM


All times are GMT +1. The time now is 08:23 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"