+ Reply to Thread
Results 1 to 13 of 13

Enter Part Of The Archive Name In A Cell,Save

  1. #1
    Registered User
    Join Date
    04-28-2009
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    49

    Enter Part Of The Archive Name In A Cell,Save

    Hello,

    I use the following macro

    Please Login or Register  to view this content.
    1.What i want is to the 3 number after PARFNP--- to be taken from the current archive name,wich is the first 3 digits,always.
    2.Then copy down where is the last written B cell,haven't manage to do that.
    3.Save as .txt (replace the current archive,wich is opened in excel,but it's .txt)

    Thanks in advance for any help

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter Part Of The Archive Name In A Cell,Save

    Hi Alogoc. Reading your macro, it appears you're first deleting the first 4 columns, just doing it one at at time. Try this, without all the "selecting".
    Please Login or Register  to view this content.
    As for your question referring to the PARFNP, what number exactly? The 170? Since you're hardcoding that whole text string into cell A1, I can't imagine how you can't just put the 170 into a variable, too.

    As for finding the next empty cell at the bottom of column B, here's one example:
    Please Login or Register  to view this content.

    If you really want this to be simple, click on GO ADVANCED and use the paperclip icon to upload a sample workbook. Show us a BEFORE and AFTER sheet so we can clearly see your goal.
    _________________
    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!)

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Enter Part Of The Archive Name In A Cell,Save

    Cross-posted here: http://www.ozgrid.com/forum/showthre...446#post502446

  4. #4
    Registered User
    Join Date
    04-28-2009
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Enter Part Of The Archive Name In A Cell,Save

    Palmetto,no need to post link,they locked the thread anyway.It's the internet,we are free and of course we can't expect information/help from one source only,as you don't always get help.

    JBeaucaire thanks so much for answering my thread.I understand that's the
    1st part is really difficult to be achieved since a text follows (both after and before) But perhaps there is a way?

    The archive is opened and save as .txt.Though it doesn't matter,because i care about the procedure that happens in excel.
    So here it is,before and after.

    Unfortunately the 3digit number cannot be obained from the A cell because it's not standard were to be found,but it's always after the word sprider,maybe can be done something with that?

    Thanks for trying help,i really hope we can get into something
    Attached Files Attached Files
    Last edited by alogoc; 09-03-2009 at 11:21 AM.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter Part Of The Archive Name In A Cell,Save

    Hi Alogoc. Be sure to read through the Forum Rules so you can use and follow them effectively. For instance, crossposting the same question in multiple forums requires you to post a link here to the other threads. It's a forum rule.

    This is all free, and we work hard to help. Crossposting almost guarantees someone is wasting their time. Since I know you don't want to waste anyone's donated time, I'm sure you now can see the benefit of requiring OPs to include cross-post links. It allows us to see/read/research what has been done already.

  6. #6
    Registered User
    Join Date
    04-28-2009
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Enter Part Of The Archive Name In A Cell,Save

    I never said you don't work hard to help people and it's really nice of you that you still keep it free,i mean it,instead of other sites.In fact i have been helped more than once in this forum and i am really thankful for that.

    I am sorry,but i did not know that i need to post the link from the other forum (yes it's my fault).But i make sure to you that if that if there was a non completed or completed solution from another forum,site,friend or anything else i would post it here...as i have done this before.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter Part Of The Archive Name In A Cell,Save

    With only one example of where the 836 is in the string, I have no way to tell what the hurdles are each time. In this instance, it appears just taking the last 3 characters would work. But you warn no, it's not standard.

    Is it always the 3 characters immediately after sprider?

    Can you provide samples of all the various sprider strings?

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter Part Of The Archive Name In A Cell,Save

    Quote Originally Posted by alogoc View Post
    I never said you don't work hard to help people and it's really nice of you that you still keep it free,i mean it,instead of other sites.In fact i have been helped more than once in this forum and i am really thankful for that.

    I am sorry,but i did not know that i need to post the link from the other forum (yes it's my fault).But i make sure to you that if that if there was a non completed or completed solution from another forum,site,friend or anything else i would post it here...as i have done this before.
    Since I'm still trying to help you, I'll also respond to this. Sometimes, the right answer is simply, "I'm sorry, I'll follow the rules. Thanks for reminding me."

  9. #9
    Registered User
    Join Date
    04-28-2009
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Enter Part Of The Archive Name In A Cell,Save

    Wow...haven't even thought about the last 3 characters!Yes it is standard!
    When i ment it's not stand i ment you won't find them in 4th,5th,6th digit etc for example,sorry if i confused you.

    In fact i think 3 last characters would work the best...it's always standard

  10. #10
    Registered User
    Join Date
    04-28-2009
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Enter Part Of The Archive Name In A Cell,Save

    You are so right...we humanoids always make things more complicated

  11. #11
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter Part Of The Archive Name In A Cell,Save

    Quote Originally Posted by alogoc View Post
    You are so right...we humanoids always make things more complicated
    Hey! Speak for yourself! (Hehe)

    Try this:
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    04-28-2009
    Location
    Athens
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Enter Part Of The Archive Name In A Cell,Save

    Hahah!Ok no rocket scientists included! :D

    And it works!Thank you so much

    About the 3rd part,i haven't found a thread about saving the current sheet in .txt.Think i should post it on another thread to make it easier to be viewed by forum users?

  13. #13
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter Part Of The Archive Name In A Cell,Save

    You can. If i were you, though, I would become a student of the Macro Recorder. The code it records includes a lot of junk, but most of all it quickly provides syntax for the functions you're trying to achieve.

    Turn it on and let it record you saving the current sheet to the text file format you desire. Then turn it off and check out the code.

    Post the code into a new thread with your questions about automating the filename portion and path, etc, everything you want help converting from the hardcode the recorder gave you to something more dynamic.

+ 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