moving records from one sheet to other

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I have 1400 records in one sheet. i want is as a read only sheet.
now i need a selection cell and a push button for each and every record.
when the shared users select their name from the selection cell then click
one of the push button then the appropriate record should move to the sheet
which is for that particular user. i have 15 sheets for every individual.can
u plz help me out.

i'm very new to excel.

knight
 
Hopefully this will help you some. This code would be attached to a single
button - what it does is see if the currently active cell is in the proper
column (with names in it) and if it is, then goes on to display proper stuff.
I don't know how you were getting around using the individual buttons, but
I've included information on what info is avaible to you here so that maybe
you can adapt your current code with it:

Sub MoveToReadOnlyPage()
'called when the button is clicked
'check to make sure ActiveCell is
'one in the name column
'if not, don't do anything
Dim isect As Range

Set isect = Application.Intersect(Range(ActiveCell.Address), Range("A:A"))
If isect Is Nothing Then
' MsgBox "Ranges do not intersect"
Exit Sub ' do nothing
End If
'if several cells are chosen, the address of the
'top (single column chosen) or Left (row chosen)
'or top-left if several columns/rows selected
'will be returned.
'
'now you can use isect like you would a cell range
'to get the .Row .Column or even the .Address
'property of it as
Dim RowToMove As Long ' if a really long list
RowToMove = isect.Row
MsgBox "You chose a cell in column A, Row " & RowToMove _
& vbCrLf & "It's address is " & isect.Address _
& vbCrLf & "It's column number is " & isect.Column
'your usual code to move stuff can be put here
'adapted to use information ripped off of isect

End Sub

If you have 2 or more adjacent columns that would be ok to be in such as
first name in column A, last name in column B, then you could change "A:A" to
"A:B" and it will work for that condition.
 
Back
Top