+ Reply to Thread
Results 1 to 3 of 3

Autocopy Cell From Previously Sheet?

  1. #1
    Registered User
    Join Date
    01-16-2007
    Posts
    2

    Red face Autocopy Cell From Previously Sheet?

    I need relative macro for autocopy range ("I4:I110") from previously sheet to ("E4:E110") in next sheet!
    I need that for my inventory list

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Does this help

    Please Login or Register  to view this content.
    VBA Noob
    Last edited by VBA Noob; 01-16-2007 at 07:08 PM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-16-2007
    Posts
    2

    Talking Thank you very much for the macro you sent me

    Sub macro()
    Dim Sht1 As Worksheet
    Set Sht1 = ActiveSheet
    Sht1.Range("I4:I110").Copy ActiveSheet.Next.Range("E4:E110")' Change Next to Previous if that's what you meant
    End Sub

    Your macro is working but I forgot to say that those two columns need to be linked, in order to see the changes that will appear in Range("I4:I110")...

    This is macro where I need to add this kind of formula, in order to be automated while starting this excel document.

    Private Sub Workbook_Open()
    ActiveSheet.Copy Before:=Sheets("NARUDŽBA")
    UserForm1.Show
    ActiveSheet.Name = Range("B2")
    End Sub
    Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
    Dim LastColumn As Integer
    Dim LastRow As Long
    Dim LastCell As Range

    If WorksheetFunction.CountA(Sh.Cells) > 0 Then

    'Search for any entry, by searching backwards by Rows.
    LastRow = Sh.Cells.Find(What:="*", After:=Sh.Cells(1, 1), _
    SearchOrder:=xlByRows, _
    SearchDirection:=xlPrevious).Row
    If LastRow <> 65536 Then LastRow = LastRow + 1

    'Search for any entry, by searching backwards by Columns.
    LastColumn = Sh.Cells.Find(What:="*", After:=Sh.Cells(1, 1), _
    SearchOrder:=xlByColumns, _
    SearchDirection:=xlPrevious).Column
    If LastColumn <> 256 Then LastColumn = LastColumn + 1

    Sh.ScrollArea = Range(Cells(1, 1), Cells(LastRow + 1, LastColumn + 1)).Address
    Else
    Sh.ScrollArea = ""
    End If

    End Sub

    Sincerely yours,

+ Reply to Thread

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