+ Reply to Thread
Results 1 to 9 of 9

Help remove the empty columns or rows

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    61

    Help remove the empty columns or rows

    how to make a macro to remove the empty columns or rows.

    example is in this excel file is when i hit the go button it will gather data from a webpage.

    I also want it to automatically delete a certain row/column that is empty and also column d to be named Season and column c to Week so all the data can be together next to each other all at once while i hit the go button.

    since column e,k,l,r, and s are empty cells i want it to automatically removed(delete) the column/row. except column d i want it to rename the cell to Season and column c where it labels G I want it to rename cell to Week.

    can someone help me on this??

    thanks so much!!

  2. #2
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Help remove the empty columns or rows

    Hi,

    I think you forgot to attach the workbook.

    abousetta

  3. #3
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Help remove the empty columns or rows

    opps i thought i did. sorry i'm new to site and i attached it but hit submit under message instead of the file uploaded lols.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Help remove the empty columns or rows

    Maybe add these lines to the end of Sub Process ():

    Please Login or Register  to view this content.
    abousetta

  5. #5
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Help remove the empty columns or rows

    still have two problems

    column e is an empty data cell didn't get removed .

    and column h which is the total column the label total and all the data in that cell got deleted

    how do i fix these two problems?? anyone can help???
    Last edited by SimonLee; 08-19-2011 at 05:38 AM.

  6. #6
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Help remove the empty columns or rows

    Hello can anyone help me with above questions?? check my book.xls file posted above.

    I still experiencing two problems. Thanks!!

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Help remove the empty columns or rows

    Hi Simon,

    Sorry I didn't see you post till now (was sleeping) because of the time difference.

    Could you please upload a new workbook with two specific worksheet:

    1. Before the implementations you wanted.

    2. After you manually made all the changes you wanted.

    Then please just tell us in an enumerated list what it is you did. An alternative is to use the macro recorder and then we can help you clean up the generated code.

    abousetta

  8. #8
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Help remove the empty columns or rows

    okay please help.

    this is what i want it to do. depending on the following link that i want to get data from in the macro code

    "URL;http://sports.yahoo.com/nfl/stats/byposition?pos=QB&conference=NFL&year=season_" & MyYear & "&timeframe=Week" & MyWeek & "&sort=718&old_category=DT" _
    , Destination:=Sheets("Web").Range("$A$1"))

    if i change pos= to one of the following WR, RB,TE, D, CB, S, LB. there will be some columns that is empty with no data. is there a code to make it dynamic like automatically know to remove the empty columns so i don't need to spend time to remove the empty column rows?? each of the following WR, RB,TE, D, CB, S, LB when i enter in the url pos= will give me different number of columns that appears on the worksheet? thanks for anyone who helps me out.

  9. #9
    Registered User
    Join Date
    08-18-2011
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Help remove the empty columns or rows

    heres the code inside the button.
    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)

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