Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default Write Data to Excel Database

I have an input form that I am trying to update an excel database with. What
I need the macro to do is using the account number find the entry in the
database and write the value that are on the input form.

Would the find and offset be the best way to do this or is their another
alternative.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Write Data to Excel Database

I would say yes.

--
Regards,
Tom Ogilvy

"James W." wrote in message
...
I have an input form that I am trying to update an excel database with.

What
I need the macro to do is using the account number find the entry in the
database and write the value that are on the input form.

Would the find and offset be the best way to do this or is their another
alternative.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Write Data to Excel Database

Hi,

If you are using a userform then this may help.

Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
'' This assumns you have a userform1 with txtbox named txtaccount
With UserForm1
Cells.Find(What:=txtaccount, LookIn:=xlValues, LookAt:=xlPart).Activate
If Err = "91" Then
MsgBox "Could not find Account: " & .txtaccount
Exit Sub
End If
''' assumes account is in column "A" '''
Cells(ActiveCell, 2).Value = .txtmytxt1 ''' assumes value goes in column
2
''or Cells(ActiveCell, 1).Offset(,1).Value = .txtmytxt1''' assumes value
goes in column 2
Cells(ActiveCell, 3).Value = .txtmytxt2 ''' assumes value goes in column
3
Cells(ActiveCell, 4).Value = .txtmytxt3 ''' assumns value goes in column
4
Cells(ActiveCell, 5).Value = .txtmytxt4 ''' assumns value goes in column
5
End With

End Sub

"James W." wrote in message
...
I have an input form that I am trying to update an excel database with.
What
I need the macro to do is using the account number find the entry in the
database and write the value that are on the input form.

Would the find and offset be the best way to do this or is their another
alternative.



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
Write Macro to Fix Data Alignment (Data dump from Crystal to Excel Karin Excel Discussion (Misc queries) 2 September 22nd 09 05:31 PM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
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
Write Data to a database Simon Shaw[_5_] Excel Programming 2 January 3rd 05 11:55 AM
Write data to access file through EXCEL Billy[_2_] Excel Programming 4 November 27th 03 04:48 PM


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