+ Reply to Thread
Results 1 to 14 of 14

delete 7 cells on each of the 35 sheets

  1. #1
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24

    delete 7 cells on each of the 35 sheets

    i am going to have 25 sheets for subcontractors in a construction magement workbook. i want to delete 7 cells on each of the 35 sheets. they will all be in the same place on all sheets. ex c7 g18 e14 etc on all 25 sheets. i was wondering if there is a way to create a function that can perform this operation. let me know if you got anything that might help.

  2. #2
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    Hi wwu-dillon,

    when you say delete the cells, do you mean clear their contents or delete the entire row or column??

    either way tho, you can write a macro that will loop through each sheet and proform this fairly easily.

    how many cells need clearing or deleting on each sheet?


    EDIT: sorry i didnt see the 7 cells part.

    can you list the 7 cells that need this and if they are to be deleted or cleared
    There are only 10 types of people in the world:
    Those who understand binary, and those who don't!

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    Add extra ranges to array

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24
    the cells are as follows: E19, E52, E118, E151, E184, E217. i thought about naming each of them their own unique name (deleteme1-70 or so) and then using range find in the macro. if there is an easier way i would love it. they can be zeroed out or replaced with a 0. both ways or either way let me know. thanks alot.

  5. #5
    Forum Contributor Stuie's Avatar
    Join Date
    09-17-2006
    Location
    Suffolk, UK
    MS-Off Ver
    Excel 2003/2007
    Posts
    432
    wwu-dillon, i would personally go with what what VBA Noob said as that is the exact same thing i was going to suggest

  6. #6
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24
    its a little confusing but i guess ill play around with it. im not trying to be difficult, this help is amazing and fast. but ill see what i can do. im almost done at work but will be back tomorrow to mess with it.

    edit: i will have many more sheets in the workbook so can i set an array for the worksheets, or does this make a big impact.

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Add the sheets to ignore on this line in lower case
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    VBA Noob

  8. #8
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24
    let me just make sur ei understand everything, and then ill ask another question.

    dim arr as variant is saying that arr( which is an array or cells) is the varialble that we will be doing "x" to. (this case deleting)

    dim i as long dont understand

    dim wsht as worksheet is defining wsht and a worksheet

    arr=array(cells) defining our array.

    below that it is a little confusing but i understand it as well.

    if i wanted to change the way i wrote the code, so that it was every worksheet defined in case. ex Case "sheet1", "sheet2". if i want the worksheets in the case to be the ones that get the array deleted from them how would i change the code.

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

  10. #10
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24
    Please Login or Register  to view this content.
    same question as above, sorry for not wraping my code =(

  11. #11
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24
    Quote Originally Posted by wwu-dillon View Post
    Please Login or Register  to view this content.
    everything is working fine up until the line:
    Please Login or Register  to view this content.
    that is where i need some help. i want it to delete the cells and when i run the macro it says there is an error in the line :
    Please Login or Register  to view this content.
    can anyone help me in fixing this issue?

  12. #12
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    What's the error message

    VBA Noob

  13. #13
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561
    It's an array or it isn't...
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    08-12-2008
    Location
    BELLINGHAM
    Posts
    24
    ok i think i got it working. im going to test it with data in the next few days and see how it goes. thank you all for your help.

    -dillon

+ Reply to Thread

Thread Information

Users Browsing this Thread

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