+ Reply to Thread
Results 1 to 2 of 2

Thread: Incrementing Last Row Address using Excel 2007 VBA

  1. #1
    Registered User
    Join Date
    01-21-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    7

    Incrementing Last Row Address using Excel 2007 VBA

    Hi,

    I had a different scenario, based on the list selection in the excel sheet 1 the entire row has to be copied to the sheet 2. so i planned my algorithm like this
    1. Find out last entered row in sheet 2 and copy the data from sheet 1 to the next row

    so for the baove point i used below code as


    Sheets("sheet2").Range(Sheets("sheet2").UsedRange.EntireRow.Address).Value = Target.EntireRow.Value

    Actually i need to do the above copy based on the condition, please find the attached excel

    But every time the value is copying in the same row in sheet 2. i tried to increment the address but i failed. Please find the enclosed attached sheet for my exact scenario. I had mentioned my validations in the excel too

    Regards
    Bhuvan
    Attached Files Attached Files
    Last edited by BhuvanRam; 02-01-2012 at 06:42 AM. Reason: Changed Excel Sheet

  2. #2
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    MS Excel 2010
    Posts
    2,247

    Re: Incrementing Last Row Address using Excel 2007 VBA

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Target.Value = "Grpaes" Then
    
    Target.EntireRow.Copy Sheets("sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
    
    End If
    End Sub

+ Reply to Thread

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.2.0