Results 1 to 21 of 21

delete row and enter formula

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    491

    delete row and enter formula

    Hi to all
    This macro
    Option Explicit
    
    
    '=SE.ERRORE(CONFRONTA(D4;articoli!B6:B8000;0)+5;0)
    
    
    Sub Canc_A_O_1_riga_new() 'mine
    
    
    
    Dim Nriga As Long
    Dim n As Long
       'Dim x As Long
    Dim avviso As String
    
    Dim SComm1, SComm2 As String
    
    
    
    SComm1 = Sheets("nuovo_articolo").Range("D4").Value
    SComm2 = Sheets("nuovo_articolo").Range("F4").Value
    
    
    
    
    If ActiveSheet.Range("F4").Value = 0 Then
    avviso = MsgBox("Sign. " & Environ("UserName") & Chr(13) & "inserisci un'articolo da eliminare," & Chr(13) & _
    "l'articolo inserito < " & SComm2 & " > " & Chr(13) & _
    "non è presente in foglio < articoli >!", _
      vbInformation + vbOKOnly + vbDefaultButton2, "AVVISO")
    Exit Sub
    End If
    
    
    
    avviso = MsgBox("elimino l'articolo < " & SComm1 & " > in riga < " & SComm2 & _
    " > ? ", vbYesNo + vbExclamation, "ATTENZIONE!")
    If avviso = vbNo Then
    Exit Sub
    End If
    
    
    
    
    Sheets("articoli").Select
    
    
    
    
    ActiveSheet.Unprotect "123456"
    
    Application.ScreenUpdating = False
    
    Nriga = SComm2
    
    Application.EnableEvents = False
                   
    
    Range(Cells(Nriga, "B"), Cells(Nriga, "Q")).ClearContents
    
    Application.EnableEvents = True
    
    
    
    
    Call rimetti_formula
    
    'Call formula_2
    
    
    ActiveSheet.Protect "123456"
    
    
    
    Sheets("nuovo_articolo").Select
    
    
    Sheets("nuovo_articolo").Range("D4").Select
    Selection.ClearContents
    
    
    Application.ScreenUpdating = True
    
    
    End Sub
    deletes the row sheet "articoli" inserted in the sheet "nuovo articolo" cell D4.
    after deleting the row the formulas of the deleted row are inserted with this macro

    Call rimetti_formula

    this macro puts the formulas back across the range and is very slow.
    this macro is possible only for the deleted row?
    I hope I have explained
    thank you
    john
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA delete cell value and enter new value
    By ioncila in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2016, 05:17 AM
  2. [SOLVED] How to delete an ENTER on a cell
    By pccamara in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-21-2016, 07:54 AM
  3. With VBA Enter Ctrl Shift Enter For Array Formula
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-17-2013, 09:02 AM
  4. [SOLVED] How do I enter a formula that will delete a line when a cell = 0?
    By Jen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-11-2006, 01:25 PM
  5. [SOLVED] Add or Delete row as per enter
    By Tiya in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-22-2005, 02:00 PM
  6. Replies: 2
    Last Post: 10-20-2005, 05:05 PM
  7. Determine if cell was modified by Enter , Paste or Delete
    By Randy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2005, 12: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