+ Reply to Thread
Page 3 of 7 FirstFirst 1 2 3 4 5 ... LastLast
Results 31 to 45 of 98

Finding last row and deleting beyond

  1. #31
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    arlette, the blank cells in column B after running code now have a duplicate entry from column A??, any ideas?

  2. #32
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,145

    Re: Finding last row and deleting beyond

    Quote Originally Posted by kevinless View Post
    keeping the macro independent - i have exported a .bas file and would import that into the new workbook, is that what you mean?
    Instead of doing this each time, you can have the macro reside in an independent file and then ask the macro to call the file which you need to run the macro on. Just a slight change of code is required and i can help you with that.

    i can see once its run it names the file as the date, not sure where it saves it?
    You can provide the path where you want the file to be saved and i can enter it into the code.

    also, can you run the macro on this raw file, its not deleting the row that has the blank field in it?
    Will check this now.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #33
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,145

    Re: Finding last row and deleting beyond

    I checked the macro. What do you mean by duplicated value from column A?

  4. #34
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    Well, can I send you a screenshot? What type of file can u open?

  5. #35
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,145

    Re: Finding last row and deleting beyond

    Any kind. Just upload it.

  6. #36
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    Quote Originally Posted by arlu1201 View Post
    Instead of doing this each time, you can have the macro reside in an independent file and then ask the macro to call the file which you need to run the macro on. Just a slight change of code is required and i can help you with that.

    You can provide the path where you want the file to be saved and i can enter it into the code.


    Will check this now.
    Path would be just the desktop do you need a directory for mac desktop??

    Call the file sounds interesting?! Does the file always have to be the same name or would it work like a hot folder queue scenario?

  7. #37
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    Quote Originally Posted by arlu1201 View Post
    Any kind. Just upload it.
    a before and after screengrab

    you can see in the original file C4 and C10 were blank, after macro they show duplicate, where if the line is deleted altogether, lines 15918 and NB*1221 should not appear at all?

    thnks

  8. #38
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    hi arlette, did you have any luck with this issue? thanks

  9. #39
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,145

    Re: Finding last row and deleting beyond

    Quote Originally Posted by kevinless View Post
    Path would be just the desktop do you need a directory for mac desktop??
    Call the file sounds interesting?! Does the file always have to be the same name or would it work like a hot folder queue scenario?
    I can give you a file open box that you can use to navigate for your file.

    Quote Originally Posted by kevinless View Post
    a before and after screengrab
    you can see in the original file C4 and C10 were blank, after macro they show duplicate, where if the line is deleted altogether, lines 15918 and NB*1221 should not appear at all?
    Do you want the rows in column B to be deleted before doing the rest of the steps? I thought its at the end and have added it to the end of the macro.

  10. #40
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    open box would be good. i would say say yes delete rows deleted then do further steps, basically so it takes the rows that have no cell data in B totally out of the equation when i save the file after the macro has run

    thanks

  11. #41
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,145

    Re: Finding last row and deleting beyond

    Try this code
    Please Login or Register  to view this content.
    It includes the popup to open the file, the blank deletion part and even saving the file. Change the section marked bold to match your system.

  12. #42
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    seems to be a slight issue here???
    Attached Images Attached Images

  13. #43
    Administrator arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,145

    Re: Finding last row and deleting beyond

    I tried it at my end and it works fine. But i am using a windows 7 PC. So maybe thats whats causing the issue at your end, since you are using a MAC. Let me push this over to a few of our MAC experts and see what they say.

  14. #44
    Registered User
    Join Date
    10-25-2012
    Location
    london
    MS-Off Ver
    Excel for mac 2011
    Posts
    75

    Re: Finding last row and deleting beyond

    ok thanks arlette

  15. #45
    @dministrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    33,062

    Re: Finding last row and deleting beyond

    Getopenfilename is not a mac function that works. Use the Applescript equivalent:

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

+ Reply to Thread
Page 3 of 7 FirstFirst 1 2 3 4 5 ... LastLast

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