• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

problem when I try to add a new row or delete a row it's case error

MAgicgood

New Member
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
any help will be more than appropriation
 

Attachments

  • S.Tawfik.xlsm
    33.4 KB · Views: 2
Last edited:
According to forum rules below first edit your post in order to modify your title with relevant words according to your issue, thanks.​
 
According to forum rules below first edit your post in order to modify your title with relevant words according to your issue, thanks.​
that i can edit my post one time only because i want to writ that it cross post but cant find edit anymore
 
According to forum rules below first edit your post in order to modify your title with relevant words according to your issue, thanks.​
Sorry for across post i learned the lesson and i will only from now on post any questions only here in this respect site thank you for your support
 
Hi ,

What is the error ?

Can you post a screenshot and explain the sequence of actions which generates the error ?

Narayan
when i try to delete range of cells i get this error
thank you very much
 

Attachments

  • Ex 1.png
    Ex 1.png
    107.3 KB · Views: 8
  • ex 2.png
    ex 2.png
    28 KB · Views: 7
Hi ,

The error you have highlighted is in the code which is sending an email. I have not looked into this code at all.

Can you do the following ?

When the error is displayed , click on the Debug button ; execution of the code will be paused , and you can examine the variables in the code.

In the Immediate window , type the following and see what is displayed :

?Target.Offset(0 , -3).Address

Can you post here what is displayed ?

Narayan
 
Hi ,

The error you have highlighted is in the code which is sending an email. I have not looked into this code at all.

Can you do the following ?

When the error is displayed , click on the Debug button ; execution of the code will be paused , and you can examine the variables in the code.

In the Immediate window , type the following and see what is displayed :

?Target.Offset(0 , -3).Address

Can you post here what is displayed ?

Narayan
first i'm really appreciate your replay very much i was no expected to have any replay . thank you
 

Attachments

  • ex 3.png
    ex 3.png
    32.8 KB · Views: 4
when i try to delete range of cells i get this error
thank you very much
Hi ,

The problem is that the range of cells you are deleting is $C$7:$I$19.

Within the code , the reference is to the following :

Target.Offset(0, -3).Value

This means the code is trying to reference a column which is 3 columns away from column C , this is an invalid reference , since :

Target.Offset(0, -1) will reference the range $B$7:$H$19

Target.Offset(0, -2)
will reference the range $A$7:$G$19

Narayan
 
Hi ,

The problem is that the range of cells you are deleting is $C$7:$I$19.

Within the code , the reference is to the following :

Target.Offset(0, -3).Value

This means the code is trying to reference a column which is 3 columns away from column C , this is an invalid reference , since :

Target.Offset(0, -1) will reference the range $B$7:$H$19

Target.Offset(0, -2)
will reference the range $A$7:$G$19

Narayan
sorry but i didn't get this . can you help me to fix this please the problem now when i try to deleting range or row get an error and really i try every thing
 

Attachments

  • S.Tawfik - Copy.xlsm
    34.8 KB · Views: 1
Hi ,

Unless you explain your requirement , nothing can be done.

Please explain what you want to do ; going through someone else's code and rectifying errors is no guarantee that your requirements will be met.

Narayan
 
what i want the code to do

1 when i write any thing in any cell E then its automatically write in Cell G "In Progress "

2 - when i select any name from drop down list in cell H create email and send it with some selected cells to the name i already select in cell H

3- when i push the button that i make and connect it to vb add a new row with all formatting in above of the selected cell or row

4 - fit zoom every time i open the file to be 100%

the problem now when i try to deleting range or row get an error and really i try every thing
 
what i want the code to do

1 when i write any thing in any cell E then its automatically write in Cell G "In Progress "

2 - when i select any name from drop down list in cell H create email and send it with some selected cells to the name i already select in cell H

3- when i push the button that i make and connect it to vb add a new row with all formatting in above of the selected cell or row

4 - fit zoom every time i open the file to be 100%

the problem now when i try to deleting range or row get an error and really i try every thing
Hi ,

Deleting a row does not figure in points 1 through 4.

Why are you deleting a row ?

Narayan
 
Back
Top