+ Reply to Thread
Results 1 to 11 of 11

Create saved database

  1. #1
    Registered User
    Join Date
    05-17-2010
    Location
    manila
    MS-Off Ver
    Excel 2003
    Posts
    4

    Create saved database

    Case Sample:
    - there are two sheets (sheet1 and sheet2)
    - sheet1, the user puts values only in cells A1:A5 and B6:B10
    - sheet1 has a savedata button and newdata button
    - sheet1 must function as a reusable form so the input data in cells A1:A5 and B6:B10 could be saved and transposed to sheet2 starting from A1:E1 and G1:K1.
    - now when the user inputs another set of values in sheet1 in A1:A5 and B6:B10 it will then be saved and transposed to sheet2 starting from A2:E2 and G2:K2
    - what is the formula for this? thanks...

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Create saved database

    Use the builtin form of Excel or use a VBA userform (that is designed for this kind of task).

  3. #3
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Create saved database

    snb, what do you mean the built in form of Excel? I know VBA userforms, but have never heard of this other type of form. Is it like an Access Form?
    BTW dbmanda, Access is much better suited to storing data like you have requested. Its easier to input, work with, and display in meaningful ways.

    That said, the basic code in excel would be:

    Please Login or Register  to view this content.


    You'll have to set up the buttons and customize as needed.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  4. #4
    Registered User
    Join Date
    05-17-2010
    Location
    manila
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Create saved database

    this is the sample vb code.... i want to use loop but i cant arrange it... please fix... thanks


    Sub SaveData()
    '
    ' SaveData Macro
    '

    '
    Do
    If IsEmpty(ActiveCell) Then
    ActiveCell.FormulaR1C1 = "=Average(RC[-1],RC[-2])"
    End If
    ActiveCell.Offset(1, 0).Select
    Loop Until IsEmpty(ActiveCell.Offset(0, 1))

    Range("B8:B10").Select
    Selection.Copy
    ActiveSheet.Next.Select
    Range("A2").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True
    Range("D2").Select
    ActiveSheet.Previous.Select
    Range("B9").Select
    Application.CutCopyMode = False
    Range("B13:B15").Select
    Selection.Copy
    ActiveSheet.Next.Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True
    Range("A2").Select
    ActiveSheet.Previous.Select
    Application.CutCopyMode = False
    End Sub

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Create saved database

    @davegugg

    Menu Bar/Data/Form
    Attached Images Attached Images
    Last edited by snb; 05-19-2010 at 12:38 PM.

  6. #6
    Registered User
    Join Date
    05-17-2010
    Location
    manila
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Create saved database

    sorry i didnt get it... what changes have you made in my vb? thanks

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

    Re: Create saved database

    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

  8. #8
    Registered User
    Join Date
    05-17-2010
    Location
    manila
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Create saved database

    Here you go

    Please Login or Register  to view this content.

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

    Re: Create saved database

    Edit the original code,don't add it again!

  10. #10
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Create saved database

    Thats interesting snb, I've never seen that before. Is it also in the US version? I don't have 03 anymore and I don't see it in 07.

  11. #11
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Create saved database

    @Davegugg
    I avn't got the faintest... (didn't see much improvement since Excel 2000).

+ 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