+ Reply to Thread
Results 1 to 10 of 10

Need Help Urgent !!!!!!!!!!!!

  1. #1
    Registered User
    Join Date
    10-30-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    92

    Import text into excel sheet

    Hi

    i am trying to write a macro to import the text file into excel

    code is working fine but i want my import to happen in the sheet i wish

    I have an excel workbook where there 2 sheets, when i run this macro from first sheet text file is imported into first sheet but i wanted that import to 2nd sheet or sheet which i want

    could you please help me to tweak this code

    Please Login or Register  to view this content.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Import text into excel sheet

    Hi, kiran527,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Last edited by Ron Coderre; 03-30-2014 at 09:44 AM.
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Import text into excel sheet

    Hi,

    Untested but perhaps

    With Activesheet.QueryTables.Add(Connection:="TEXT;" & fname, Destination:=Sheet2.Range("$A$1"))
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: Import text into excel sheet

    Hi Kiran527,

    i have just edited one thing from Richard buttrey's code.......
    Since your need was import to happen in any sheet you want not just sheet1 or sheet2..

    And definitely not tested. Please give a try.

    HTML Code: 
    If my reply helped you.....
    Click the small star icon at the bottom left of my post "Add Reputation" and mark the post suitably as solved.

  5. #5
    Registered User
    Join Date
    10-30-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    92

    Re: Import text into excel sheet

    Quote Originally Posted by prabhuduraraj09 View Post
    Hi Kiran527,

    i have just edited one thing from Richard buttrey's code.......
    Since your need was import to happen in any sheet you want not just sheet1 or sheet2..

    And definitely not tested. Please give a try.

    HTML Code: 
    If my reply helped you.....
    Click the small star icon at the bottom left of my post "Add Reputation" and mark the post suitably as solved.
    Hey thanks for the responses thats works good but the problem is

    when i m exporting the data to excel sheet, it loosing the original data
    suppose if the text file is having a value as "0000" then it is converted to "0"
    could you please help me.....

  6. #6
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: Import text into excel sheet

    Hi,

    Did you face this issue only after including the new code?
    Last edited by Ron Coderre; 03-30-2014 at 09:46 AM.

  7. #7
    Registered User
    Join Date
    10-30-2012
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    92

    Re: Import text into excel sheet

    no i had this issue even before i want to get rid of this......
    Last edited by Ron Coderre; 03-30-2014 at 09:47 AM.

  8. #8
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: Import text into excel sheet

    Hi Kiran527,

    In that case, I would suggest to post this Query separately.
    Since this current thread is answered and hope it was help full please mark the thread as solved
    and Add reputation if you are happy with the reply.
    Last edited by Ron Coderre; 03-30-2014 at 09:47 AM.

  9. #9
    Forum Contributor prabhuduraraj09's Avatar
    Join Date
    05-19-2012
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    330

    Re: Import text into excel sheet

    Hi Kiran527,

    Sorry to followup.
    Since you have started new Thread for the last Query.

    Please have this thread flaged as solved appropriately as per Forum rules.
    And Add reputation for the helped user.

    This would give the Forum clean and go on attitude to help others as well.

    Hope you agree with me.
    Last edited by Ron Coderre; 03-30-2014 at 09:48 AM.

  10. #10
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Import text into excel sheet

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore requests by Administrators, Moderators and senior forum members regarding forum rules.

    If you are unclear about the request or instruction then send a private message to them asking for clarification. Do not post a reply in a thread where a moderator has requested an action that has not yet been complied with e.g Title change or Code tags...etc
    Last edited by Ron Coderre; 03-30-2014 at 09:49 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [URGENT][Help with a VBA Macro - Maximum with criterias][URGENT]
    By mahmoudmerhi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2013, 03:39 PM
  2. Need urgent help with error! Urgent!
    By heidenman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-03-2009, 04:31 AM
  3. Urgent Please!
    By balmalik in forum Excel General
    Replies: 2
    Last Post: 08-09-2006, 02:40 AM
  4. Urgent-Urgent VBA LOOP
    By Jeff in forum Excel General
    Replies: 0
    Last Post: 10-06-2005, 01:05 PM
  5. [SOLVED] *URGENT*
    By Stacy in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM

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