+ Reply to Thread
Results 1 to 4 of 4

VBA automatically Cut and Past (cut and past it into the different work sheet)

Hybrid View

  1. #1
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA automatically Cut and Past (cut and past it into the different work sheet)

    A couple of small changes:

    Option Explicit
    Dim M As String
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    If Sh.Name <> "Total" And Target.Count = 1 Then
    If Target.Column = 2 And IsDate(Target) Then
    M = Left(MonthName(Month(Target)), 3)
    If Sh.Name = M Then Exit Sub
    Application.EnableEvents = False
    Call seifeddine(Target)
    Dim r As Long: r = Target.Row
    Sh.Unprotect: With Sh 'SKIP K,P And V
    .Cells(r, 1).Resize(1, 10).Value = ""
    .Cells(r, 12).Resize(1, 4).Value = ""
    .Cells(r, 17).Resize(1, 5).Value = ""
    .Cells(r, 23).Resize(1, 2).Value = ""
    End With
    Application.EnableEvents = True: End If: End If
    End Sub
    Sub seifeddine(T As Range): Dim r As Long, ws As Worksheet
    Set ws = Sheets(M)
    r = ws.Range("A" & Rows.Count).End(xlUp).Row + 1
    ws.Unprotect
    Application.DisplayAlerts = False
    T.Offset(0, -1).Resize(1, 24).Copy ws.Cells(r, 1)
    Application.DisplayAlerts = True
    ws.Protect
    End Sub
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  2. #2
    Registered User
    Join Date
    09-15-2015
    Location
    england
    MS-Off Ver
    2013
    Posts
    19

    Re: VBA automatically Cut and Past (cut and past it into the different work sheet)

    workes perfect i do appreciated xladept and a lot of respect

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Can't scroll down past row 260, or past column Y in Excel 2003....
    By damianberry in forum Excel General
    Replies: 2
    Last Post: 12-11-2012, 01:00 AM
  2. Replies: 4
    Last Post: 11-20-2012, 05:25 PM
  3. [SOLVED] Calculate total dollar amount the is past the past due date
    By Barb1980 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-12-2012, 05:34 PM
  4. Replies: 2
    Last Post: 09-04-2012, 01:19 AM
  5. Automatically move past due projects
    By Wes.T.S in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-20-2011, 01:40 PM
  6. Copy and Past to Differerent Work Sheet
    By Terry in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-07-2005, 04:05 PM
  7. Past Value automatically
    By TM in forum Excel General
    Replies: 2
    Last Post: 01-06-2005, 02:06 PM

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