+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 Database help

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    Smile Excel 2007 Database help

    Hi All,

    I am trying to create a database using Excel 2007. I have maneged to find the VBA code to enable me to save data on a separate tab of a workbook by filling in data within a form on a different tab.

    The code I used is below :

    Dim wsData As Worksheet
    Dim wsForm As Worksheet
    Dim rNextCl As Range
    Sub Save_Data()

    Set wsData = Sheet2
    Set wsForm = Sheet1

    Set rNextCl = wsData.Cells(65536, 2).End(xlUp).Offset(1, 0)


    With rNextCl
    .Value = wsForm.Cells(5, 4).Value

    .Offset(0, 1).Value = wsForm.Cells(6, 4).Value
    .Offset(0, 2).Value = wsForm.Cells(7, 4).Value
    .Offset(0, 3).Value = wsForm.Cells(8, 4).Value
    .Offset(0, 4).Value = wsForm.Cells(9, 4).Value
    .Offset(0, 5).Value = wsForm.Cells(10, 4).Value
    .Offset(0, 6).Value = wsForm.Cells(11, 4).Value
    .Offset(0, 7).Value = wsForm.Cells(12, 4).Value
    .Offset(0, 8).Value = wsForm.Cells(13, 4).Value
    .Offset(0, 9).Value = wsForm.Cells(14, 4).Value
    .Offset(0, 10).Value = wsForm.Cells(15, 4).Value
    .Offset(0, 11).Value = wsForm.Cells(16, 4).Value
    .Offset(0, 12).Value = wsForm.Cells(17, 4).Value
    .Offset(0, 13).Value = wsForm.Cells(18, 4).Value
    .Offset(0, 14).Value = wsForm.Cells(19, 4).Value
    .Offset(0, 15).Value = wsForm.Cells(20, 4).Value
    .Offset(0, 16).Value = wsForm.Cells(21, 4).Value
    .Offset(0, 17).Value = wsForm.Cells(22, 4).Value
    .Offset(0, 18).Value = wsForm.Cells(23, 4).Value
    .Offset(0, 19).Value = wsForm.Cells(24, 4).Value
    End With

    MsgBox "Data transferred successfully" & vbCrLf & "", vbInformation, "Data transfer"

    wsForm.Range("DataInput").ClearContents

    Set wsData = Nothing
    Set wsForm = Nothing
    Set rNextCl = Nothing

    End Sub

    Now I am trying to include a find, amend and delete function for this database.

    I would like the find function to extract the data from the seperate tab and populate this onto the form by typing a value within the form itself.

    I would also like to be able to amend the data onto the form and re save this within the database.

    Lastly I would like to be able to delete records


    I have tried and failed! miserably to do this. Can anyone please help me! im pulling my hair out. any insight will be greatly appreciated.

    I have attached a copy of the database for your viewing.

    I thank you in advanced for your help!!! :-)
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Excel 2007 Database help

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1