Consulting

Results 1 to 9 of 9

Thread: Vba to include comments

  1. #1

    Vba to include comments

    I want to amend this code so that the comments save with each record but I don't know how to amend the code. Can anyone help? (If anyone could suggest the best way of learning VBA that would be very useful as well).
    Attached Files Attached Files

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    I don't which part of the code you want changing, but you can do it yourself:
    Where in the code you have the likes of:
    [vba].Cells(lRecRow, 3).PasteSpecial Paste:=xlPasteValues, Transpose:=True[/vba] add a line next to it (above or below) which is identical except for one thing:
    xlPasteValues
    changes to:
    xlPasteComments
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    See if this does what you need.
    Attached Files Attached Files

    David


  4. #4
    David that is awesome this does what I need it to do. What part of the code did you change?
    Last edited by steads1980; 02-26-2011 at 01:05 AM.

  5. #5
    p45cal Thanks for your post

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Quote Originally Posted by steads1980
    p45cal Thanks for your post
    nothing like a bit of ambiguity to keep one on one's toes…
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  7. #7
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    Quote Originally Posted by steads1980
    What part of the code did you change?
    In Module ModData, Sub UpdateLogRecord(), added
    [vba].Cells(lRecRow, "X") = Worksheets("Input").Range("G4").Value[/vba] This copies the comment block from Input sheet to Data sheet.

    In Module modViewData; all four Subs get the line
    [vba].Range("G4").Value = DataWks.Range("X" & lRecRow).Value[/vba] When you press the navigation buttons in the View Records frame, this copies the comment from the Data sheet to the Input sheet.

    HTH,

    David


  8. #8
    How to I change the code so it also works with the drop down menu?

  9. #9
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    In the worksheet_change event.
    Attached Files Attached Files

    David


Posting Permissions

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