Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 3
Default Using userforms to edit cells

I posted a similar question some time ago but couldn't get things work.

I have a sheet with loads of data in and I wish to create a userform to edit
the data that is already in the sheet. I want the userform to scroll though
the records to one that I want, thus enabling me to edit the data. I have
already set up the userform to input the data, but the facility to edit has
now arisen.

Can anyone help.

PS I'm not an experienced programmer, just someone who uses it now and again.

Tom
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Using userforms to edit cells

Consider using the built-in Data, Form feature. Assign the name "database"
to your data range first.

John Walkenbach has an enhanced version of this you might look at. The
fourth item he

http://www.j-walk.com/ss/excel/files/general.htm


--
Jim
"Tom" (no spam ha ha) wrote in message
...
|I posted a similar question some time ago but couldn't get things work.
|
| I have a sheet with loads of data in and I wish to create a userform to
edit
| the data that is already in the sheet. I want the userform to scroll
though
| the records to one that I want, thus enabling me to edit the data. I have
| already set up the userform to input the data, but the facility to edit
has
| now arisen.
|
| Can anyone help.
|
| PS I'm not an experienced programmer, just someone who uses it now and
again.
|
| Tom


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Using userforms to edit cells

Hi there

You could also try using something like the code below which will
search the named worksheet for the value entered in textbox1 if it is
found it will show the details of the adjacent cells in textbox2 and
textbox3.

Once you have the data shown in your form you can then edit it and use
the code for the second button to put the values back into the
worksheet.

This should work OK providing you now what you are searching for and
that each reference is unique. If your data doesn't fall under that
umbrella then the code should be modified easily enough to allow for
this, in theory. It's probably not the cleanest way to do it but it
will work providing the conditions are right.

Option Explicit
Dim FCell
Dim ImLookingFor As String

Private Sub CommandButton1_Click()

On Error Resume Next 'Set this to trap the reference not being found

ImLookingFor = TextBox1.Value

If ImLookingFor < "" Then 'Ensure something has been entered to look
for

With Sheets("Sheet1") 'change this to the name of your sheet

Set FCell = Cells.Find(What:=ImLookingFor, LookAt:=xlWhole)

If FCell Is Nothing Then 'If you don't find what your
looking for

MsgBox ImLookingFor & " not found in Last Tab!"

Resume Next

Else 'If you do find what your looking for

FCell.Activate

TextBox2.Value = ActiveCell.Offset(0, 1).Value

TextBox3.Value = ActiveCell.Offset(0, 2).Value

End If

End With

End If

End Sub

Private Sub CommandButton2_Click()

ActiveCell.Value = TextBox1.Value 'Put the values to the cells

ActiveCell.Offset(0, 1).Value = TextBox2.Value

ActiveCell.Offset(0, 2).Value = TextBox3.Value

End Sub

Hope this helps you out

S



  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 3
Default Using userforms to edit cells

Is there any way of amending the Form that comes with Excel. I would like to
alter the layout and add some other buttons.

Tom

"Incidental" wrote:

Hi there

You could also try using something like the code below which will
search the named worksheet for the value entered in textbox1 if it is
found it will show the details of the adjacent cells in textbox2 and
textbox3.

Once you have the data shown in your form you can then edit it and use
the code for the second button to put the values back into the
worksheet.

This should work OK providing you now what you are searching for and
that each reference is unique. If your data doesn't fall under that
umbrella then the code should be modified easily enough to allow for
this, in theory. It's probably not the cleanest way to do it but it
will work providing the conditions are right.

Option Explicit
Dim FCell
Dim ImLookingFor As String

Private Sub CommandButton1_Click()

On Error Resume Next 'Set this to trap the reference not being found

ImLookingFor = TextBox1.Value

If ImLookingFor < "" Then 'Ensure something has been entered to look
for

With Sheets("Sheet1") 'change this to the name of your sheet

Set FCell = Cells.Find(What:=ImLookingFor, LookAt:=xlWhole)

If FCell Is Nothing Then 'If you don't find what your
looking for

MsgBox ImLookingFor & " not found in Last Tab!"

Resume Next

Else 'If you do find what your looking for

FCell.Activate

TextBox2.Value = ActiveCell.Offset(0, 1).Value

TextBox3.Value = ActiveCell.Offset(0, 2).Value

End If

End With

End If

End Sub

Private Sub CommandButton2_Click()

ActiveCell.Value = TextBox1.Value 'Put the values to the cells

ActiveCell.Offset(0, 1).Value = TextBox2.Value

ActiveCell.Offset(0, 2).Value = TextBox3.Value

End Sub

Hope this helps you out

S




  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Tom is offline
external usenet poster
 
Posts: 3
Default Using userforms to edit cells

Is there any way of aletering the look of the standard form in excel, eg add
a OK?cancel button or move the text boxes?

Tom

"Jim Rech" wrote:

Consider using the built-in Data, Form feature. Assign the name "database"
to your data range first.

John Walkenbach has an enhanced version of this you might look at. The
fourth item he

http://www.j-walk.com/ss/excel/files/general.htm


--
Jim
"Tom" (no spam ha ha) wrote in message
...
|I posted a similar question some time ago but couldn't get things work.
|
| I have a sheet with loads of data in and I wish to create a userform to
edit
| the data that is already in the sheet. I want the userform to scroll
though
| the records to one that I want, thus enabling me to edit the data. I have
| already set up the userform to input the data, but the facility to edit
has
| now arisen.
|
| Can anyone help.
|
| PS I'm not an experienced programmer, just someone who uses it now and
again.
|
| Tom





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Using userforms to edit cells

Not the builtin version.

But John Walkenbach does provide access to the code ($20 US, IIRC). Then you
can do as much damage <vbg as you want.

Tom wrote:

Is there any way of aletering the look of the standard form in excel, eg add
a OK?cancel button or move the text boxes?

Tom

"Jim Rech" wrote:

Consider using the built-in Data, Form feature. Assign the name "database"
to your data range first.

John Walkenbach has an enhanced version of this you might look at. The
fourth item he

http://www.j-walk.com/ss/excel/files/general.htm


--
Jim
"Tom" (no spam ha ha) wrote in message
...
|I posted a similar question some time ago but couldn't get things work.
|
| I have a sheet with loads of data in and I wish to create a userform to
edit
| the data that is already in the sheet. I want the userform to scroll
though
| the records to one that I want, thus enabling me to edit the data. I have
| already set up the userform to input the data, but the facility to edit
has
| now arisen.
|
| Can anyone help.
|
| PS I'm not an experienced programmer, just someone who uses it now and
again.
|
| Tom




--

Dave Peterson
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
Edit cut cells Joe[_14_] Excel Discussion (Misc queries) 1 June 16th 09 08:56 PM
how to edit cells Ralf Dieckmann New Users to Excel 2 April 14th 08 10:58 PM
Userforms Values to Workbook Cells Mark Dullingham Excel Programming 7 March 4th 07 05:06 PM
Updating Cells w/ Userforms AndrewAK[_2_] Excel Programming 0 October 21st 04 03:24 PM


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

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"