Please Please someone help me i'm gon to be mad

magicgood

New Member
Joined
Dec 22, 2019
Messages
9
Office Version
  1. 2013
Platform
  1. Windows
I trying to make a project to my work but I stuck now with Vb for like a week every time I fix a problem I faced a new one until now I face a problem I can't solve it I will attach the file and the problem when I try to add a new row or delete a row it's case error
link to my file :

my code in worksheet section
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E:E")) Is Nothing Then

ElseIf Range("E" & Target.Row) <> "" Then
Range("G" & Target.Row) = "In Progress"
Else
Range("g" & Target.Row) = ""
End If

If Not Application.Intersect(Range("H:H"), Range(Target.Address)) _
Is Nothing Then
Dim myToAdd As String

If Target.Column = 8 Then
If Target.Value = "" Then Exit Sub
If Target.Value = "Test1" Then
myToAdd = "Test1@test1.com"
ElseIf Target.Value = "test2" Then
myToAdd = "Test2@test2.com"

'Else
'etc.....
End If
If MsgBox("Do you want to send EMAIL to " & Target & " ?", vbYesNo + vbQuestion, "Confirm Sending Email") = vbNo Then Exit Sub
End If


With CreateObject("Outlook.Application").CreateItem(0) '0 will create a new email item
.To = myToAdd
.CC = ""
.Subject = "You Have a new ( Activities / Tasks / Items )" & " " & Target.Offset(0, -3).Value & " " & "assigned to you"
.Body = "Dear," & " " & Target & vbNewLine & vbNewLine & "You Have a new ( Activities / Tasks / Items )" & " " & Target.Offset(0, -3).Value & " " & "assigned to you Please follow up till have it Closed or assigned to the responsible ." & vbNewLine & vbNewLine & vbNewLine & vbNewLine & "Keep it up" & vbNewLine & "STANDARDIZATION & COMPLIANCE"
.display 'Change this to .Send
End With

End If

End Sub


code in work book section
Private Sub Workbook_Open()
ActiveWindow.Zoom = 100
End Sub

code in module
Option Explicit

Private Sub CommandButton1_Click()
addNewRow
End Sub

Sub addNewRow()

' Do not insert a row before the first row.
Dim iTopRow As Integer
iTopRow = 5

If (ActiveCell.Row > iTopRow) Then

' Get the active row number.
Dim rowNum As Integer
rowNum = ActiveCell.Row

Rows(rowNum).EntireRow.Insert ' Insert a new row.

' Change the Codes (in first column).
Cells(ActiveCell.Row, 1) = rowNum - 4 ' For the active cells.

Dim iTotalRows As Integer ' Get the total used range rows.
iTotalRows = ActiveSheet.UsedRange.Rows.Count

Dim iRows As Integer

For iRows = rowNum + 1 To iTotalRows
Cells(iRows, 1) = iRows - 4
Cells(Application.ActiveCell.Row, 7).Select
Next iRows
End If
End Sub



any help will be more than appropriation
 
Last edited by a moderator:
@magicgood
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

Please supply links to ALL other sites where you have asked this question.
i'm sorry for that again and i respect the rules
1- how can i solve the problem with add or remove row in vba
2- VBA Error When Add / Delete a Row
3- problem when I try to add a new row or delete a row it's case error

thank you in advance
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,223,958
Messages
6,175,633
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top