Consulting

Results 1 to 5 of 5

Thread: Solved: Amend cell in row based on value in first cell

  1. #1
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location

    Solved: Amend cell in row based on value in first cell

    I have a form which displays the contents of a row of cells wher the first cell is a unique Id for that row (a Pay roll number)

    I want to be able to amend the details shown on the user form and then those amendments alter the cells in the same row as the unique ID accordingly

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    When you get the details, save the row number, then use it to write-back

    [vba]

    Range("A" & SavedRow).Value = TextBox1.Text
    [/vba]

    etc.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location
    Quote Originally Posted by xld
    When you get the details, save the row number, then use it to write-back

    [vba]

    Range("A" & SavedRow).Value = TextBox1.Text
    [/vba]

    etc.
    Not quite sure what you mean

    What does the "A" represent? the column in which the data will change?

    I have attached a stripped down version of my database
    Select an employee from the list box and hit select button
    This will display the detail form
    If the 1st line address field is changed and then the amend button is pressed I want the amendments to be made to the data sheet for that employee record
    Last edited by lifeson; 07-20-2007 at 08:37 AM.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub cmdClose_Click()
    Dim iRow As Long

    With Worksheets("Data")
    iRow = Application.Match(Val(txtPayNo.Text), .Columns(1), 0)
    .Range("I" & iRow).Value = Me.TxtFirstName.Text
    'and the rest
    End With

    Unload Me
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Tutor
    Joined
    Dec 2006
    Posts
    271
    Location
    As usual XLD thanks a million

Posting Permissions

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