Results 1 to 6 of 6

2nd Updating Cell with VBA?

Threaded View

Greg777 2nd Updating Cell with VBA? 01-13-2012, 06:41 PM
TMS Re: 2nd Updating Cell with... 01-13-2012, 07:00 PM
TMS Re: 2nd Updating Cell with... 01-13-2012, 07:44 PM
Greg777 Re: 2nd Updating Cell with... 01-13-2012, 08:39 PM
TMS Re: 2nd Updating Cell with... 01-13-2012, 07:36 PM
Greg777 Re: 2nd Updating Cell with... 01-21-2012, 11:31 PM
  1. #1
    Registered User
    Join Date
    08-21-2010
    Location
    Omaha, NE
    MS-Off Ver
    Excel 2003
    Posts
    45

    2nd Updating Cell with VBA?

    Hello,

    Whenever cell A1 has a new value, it is recorded in column K. I would like the VBA code to do the same for cell A2 & column L.

    Here is the VBA code that I have used for cell A1:

    '1st
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim AAA As Long
    
    AAA = Range("K" & Rows.Count).End(xlUp).Row
    
    If [A1] <> Range("K" & AAA) Then
        Application.EnableEvents = False
        Range("K" & AAA + 1).Value = [A1].Value
        Application.EnableEvents = True
    End If
    End Sub
    I've attached 2 files.
    The file that ends with an 'a' is works as expected.
    The file ending in 'b' attempts to do the same thing, but twice, acting on two cells at once and gives an error. I'd like to get this to work, in file 'b'.

    Thanks for any help!

    Greg
    Attached Files Attached Files
    Last edited by Greg777; 01-21-2012 at 11:34 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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