+ Reply to Thread
Results 1 to 3 of 3

VBA code for aligning excel file converted from text file.

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    VBA code for aligning excel file converted from text file.

    Hi Friends,

    I have converted text file to excel file and having some field alignment problem. Here are they:

    1) Data are from column A to column AO.
    2) Data available in all fields of A.
    3) Check all data from C to AO in all rows. If all fields are blank(ignore A & B), delete entire row.
    4) Check value in field O, If empty, check next row field D. IF empty, check until field D has value.
    5) Cut the data from field D to end of row (say upto AZ)and paste it in field O of point # 4.
    (i.e., check values of O1,O2,O3..... If O15 is empty then check D16 and if it has value, cut D16:AZ16 and paste it in O15 and delete row16. Check until nth row)
    6) continue until end of last row.(may be upto 10,000 rows)

    Could anyone provide me a VBA code for the above steps?

    Thanks in advance.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,872

    Re: VBA code for aligning excel file converted from text file.

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Kuwait
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA code for aligning excel file converted from text file.

    Thank you for your reply Mr. Alansidman,

    I have attached the sample file. Is it okay?

    Thanks once again.
    Attached Files Attached Files

+ 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. Replies: 4
    Last Post: 03-28-2013, 08:43 AM
  2. Replies: 1
    Last Post: 02-09-2013, 02:15 AM
  3. Replies: 0
    Last Post: 07-03-2012, 07:37 PM
  4. VBA code to import text file to the fixed excel file
    By wangdian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-30-2010, 10:13 AM
  5. [SOLVED] Can an Excel file be converted to a word doc?
    By Donna in forum Excel General
    Replies: 1
    Last Post: 10-26-2005, 05: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