+ Reply to Thread
Results 1 to 4 of 4

Empty column within an array

  1. #1
    Registered User
    Join Date
    08-18-2015
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    69

    Empty column within an array

    Hi,

    For a tool that i'm building, i have to do a lot of calculations in several worksheets trough VBA. since i was told that doing this in an array instead of the worksheet itself, i decided to use the array option to load in the worksheet data, do my calculations within the array and then put the array back into the worksheet.

    My Code is as follow:

    Please Login or Register  to view this content.
    The ColumnLoop and GetResource are defined in the rest of the code, and this works. My Problem is the "MyLoopRange(UBound(MyLoopRange, 1), MyReadColumn).ClearContents" part. I want to empty this column of the array, but my code doesn't work .

    Any thoughts?

    Thanks in advance!

    Bart

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Empty column within an array

    Bart

    ClearContents is used with a Range object, you can't use it with an array.

    To clear the column you might just have to loop, though if you can explain further what you are trying to do then some other method/approach might be possible.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    08-18-2015
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    69

    Re: Empty column within an array

    Hi Norie,

    Thanks for the quick reply!

    The GetResource = CheckResource tells me wether or not i have to empty all the rows for that column. Further into the whole code, i'm calling a function to fill these rows again. There is a scenario possible that the new situation has less rows filled then the old situation.

    Looping can be an option, but im affraid of the extra time it can take..

    What are your thoughts on this?

    Regards,

    Bart

  4. #4
    Registered User
    Join Date
    08-18-2015
    Location
    Utrecht, Netherlands
    MS-Off Ver
    2010
    Posts
    69

    Re: Empty column within an array

    Looping did the job just fine!

    Tnx!

+ 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. [SOLVED] 2 Column Lookup with 6 Column array Col index number is Varies Within Entire Array
    By Weasyb in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-05-2015, 12:54 PM
  2. Excel VBA evaluate if Cell in column D is empty and Cell in column A is not empty
    By Jovillanueva in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-02-2014, 08:09 PM
  3. Replies: 5
    Last Post: 05-13-2014, 10:19 AM
  4. Need to find empty filled cells in a column and copy to the empty cell below
    By Grahamfeeley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-30-2014, 10:09 AM
  5. Copy/Paste to Next Empty Row Overwriting Previous Row When Column A Is Empty
    By grantfitz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2013, 04:34 PM
  6. [SOLVED] Empty Array
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2005, 01: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