Results 1 to 26 of 26

Macro to copy/paste info in different sheets and to delete last entry

Threaded View

barcas84 Macro to copy/paste info in... 01-17-2012, 05:14 PM
JBeaucaire Re: Macro to copy/paste info... 01-17-2012, 08:50 PM
barcas84 Re: Macro to copy/paste info... 01-19-2012, 10:48 AM
JBeaucaire Re: Macro to copy/paste info... 01-19-2012, 11:15 AM
barcas84 Re: Macro to copy/paste info... 01-31-2012, 12:21 PM
barcas84 Re: Macro to copy/paste info... 01-19-2012, 12:13 PM
JBeaucaire Re: Macro to copy/paste info... 01-19-2012, 04:00 PM
barcas84 Re: Macro to copy/paste info... 01-19-2012, 04:14 PM
barcas84 Re: Macro to copy/paste info... 01-24-2012, 12:21 PM
barcas84 Re: Macro to copy/paste info... 01-24-2012, 12:23 PM
JBeaucaire Re: Macro to copy/paste info... 01-31-2012, 12:43 PM
barcas84 Re: Macro to copy/paste info... 01-31-2012, 01:36 PM
JBeaucaire Re: Macro to copy/paste info... 01-31-2012, 01:50 PM
barcas84 Re: Macro to copy/paste info... 01-31-2012, 02:07 PM
JBeaucaire Re: Macro to copy/paste info... 01-31-2012, 07:57 PM
barcas84 Re: Macro to copy/paste info... 02-01-2012, 09:50 AM
JBeaucaire Re: Macro to copy/paste info... 02-01-2012, 11:07 AM
JBeaucaire Re: Macro to copy/paste info... 02-01-2012, 11:17 AM
barcas84 Re: Macro to copy/paste info... 02-01-2012, 11:40 AM
JBeaucaire Re: Macro to copy/paste info... 02-01-2012, 03:04 PM
barcas84 Re: Macro to copy/paste info... 02-01-2012, 05:42 PM
barcas84 Re: Macro to copy/paste info... 02-01-2012, 04:57 PM
JBeaucaire Re: Macro to copy/paste info... 02-02-2012, 11:13 AM
barcas84 Re: Macro to copy/paste info... 02-02-2012, 11:59 AM
JBeaucaire Re: Macro to copy/paste info... 02-02-2012, 02:17 PM
barcas84 Re: Macro to copy/paste info... 02-02-2012, 02:30 PM
  1. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to copy/paste info in different sheets and to delete last entry

    These macros should work together to accomplish that.

    Option Explicit
    Public wsCnt As Long
    
    Sub CopySequential()
    
        If wsCnt = 0 Then SetCount
        If wsCnt = 50 Then MsgBox "No more" Else wsCnt = wsCnt + 1
    
        With Sheets("Calculations" & wsCnt)
            .Range("E29").Value = Sheets("DataEntry").Range("C22").Value
            .Range("G29").Value = Sheets("DataEntry").Range("E22").Value
            .Range("E33").Value = Sheets("DataEntry").Range("C25").Value
            .Range("G33").Value = Sheets("DataEntry").Range("E25").Value
            .Range("E31").Value = Sheets("DataEntry").Range("G24").Value
        End With
    
    End Sub
    
    Sub DeleteSequential()
    
        If wsCnt = 0 Then SetCount
        If wsCnt = 0 Then
            MsgBox "No data to delete"
        Else
            Sheets("Calculations" & wsCnt).Range("E29,G29,E33,G33,E31").Value = ""
            wsCnt = wsCnt - 1
        End If
        
    End Sub
    
    Sub SetCount()
    Dim w As Long
    
        For w = 50 To 1 Step -1
            If Sheets("Calculations" & w).Range("E29") <> "" Then
                wsCnt = w
                Exit Sub
            End If
        Next w
    
    End Sub
    Last edited by JBeaucaire; 01-31-2012 at 07:55 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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