+ Reply to Thread
Results 1 to 10 of 10

Finding next empty column

  1. #1
    Registered User
    Join Date
    08-10-2007
    Posts
    34

    Finding next empty column

    I need to append this macro to find the next empty column to place the data in. The orignal VBA works fine, but I need to go into the editor, and repalce the offset number every time I add a new row (weekly).

    Here's the orignal coding:

    Please Login or Register  to view this content.

    I tried this, but it's not working as i would have hoped.
    Please Login or Register  to view this content.
    Any grand ideas you gurus?

    `engineers08

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    Hi,

    Can you upload a sample sheet..clearly stating what you would like the macros to do..

  3. #3
    Registered User
    Join Date
    08-10-2007
    Posts
    34
    Sure.

    Here's an example. I need to take the data from the "New Data" sheet, then find which values are missing, and fill them with 0's. It then needs to copy this data over to the "Report" sheet, and place it in the next open column.

    The code works fine for everything but finding the next empty column to paste it. I currently change the offset value everytime.


    `engineers08
    Attached Files Attached Files

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why would adding a row affect the Column offset?

    Is this what you want
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    08-10-2007
    Posts
    34
    This script gives me a runtime error at this point.

    Please Login or Register  to view this content.
    Any idea why?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you attach the workbook?

  7. #7
    Registered User
    Join Date
    08-10-2007
    Posts
    34
    Yup, can do.
    Attached Files Attached Files

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this instead

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-10-2007
    Posts
    34
    The code to find the next column and fill it works great, but the now my coding for finding the un-included values and filling them with zero's is not working. The code here returns

    34
    2143
    552
    3
    0
    0
    0

    What I needed, and used to obtain, was
    34
    2143
    552
    3
    0
    2354
    0
    32


    Any idea why the mechanics of the macro changed? I have added the macro, and uploaded the workbook again.


    `Ryan
    Attached Files Attached Files

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this
    Please Login or Register  to view this content.

+ 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. How to change values in one column based upon values in another column
    By TomT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-26-2008, 03:02 AM
  2. Finding certain values in column
    By Alex01 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-13-2008, 11:06 AM
  3. Enhance column A through column C allowing duplicates
    By julia81 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 04-13-2008, 03:22 AM
  4. finding specific character in a column
    By LiamF in forum Excel General
    Replies: 2
    Last Post: 04-16-2007, 07:22 AM
  5. Find Unique row and sum and other questions
    By ahmedwaseem2000 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-05-2006, 07:06 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