Results 1 to 6 of 6

Worksheet_Change(ByVal Target As Range) update horizontally.

Threaded View

  1. #1
    Registered User
    Join Date
    02-10-2010
    Location
    India
    MS-Off Ver
    Office XP
    Posts
    10

    Red face Worksheet_Change(ByVal Target As Range) update horizontally.

    hi!

    I'm using Windows XP and Office XP.

    My query is :
    I have the following code. which is updating data in "A1" to Column "B" for next 30 rows i.e."b1","b2","b3" and so on till ("b30")next 30 rows.

    For my new project in which I have 500 cells i.e. "A1" to "A500"(which is vertically updating into different sheets, excel add-in name is traderxl). And I want to update them horizontally. i.e. the data will update to "f1","g1","h1" and so on till("am1") next 30 columns(in a single sheet).
    I tried a lot with my knowledge but couldn't make it. So, your help as usual is needed.

    Thanks in advance!

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim NR As Long
    If Not Intersect(Target, Range("A1")) Is Nothing Then
    NR = Range("B" & Cells(Rows.Count).Row).End(xlUp).Row + 1
    Range("B" & NR).Value = Range("A1").Value
    If NR > 30 Then Range("B1").Delete xlShiftUp
    End If
    End Sub
    Last edited by DonkeyOte; 02-10-2010 at 03:14 AM. Reason: added closing CODE tag

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