Results 1 to 27 of 27

Using Named Ranges to allow for Inserting Cells Within a VBA Coded Range

Threaded View

timmymckinney Using Named Ranges to allow... 06-11-2013, 02:12 PM
jaslake Re: Using Named Ranges to... 06-12-2013, 12:50 PM
timmymckinney Re: Using Named Ranges to... 06-12-2013, 01:31 PM
jaslake Re: Using Named Ranges to... 06-12-2013, 04:37 PM
jaslake Re: Using Named Ranges to... 06-12-2013, 05:45 PM
jaslake Re: Using Named Ranges to... 06-13-2013, 09:22 PM
timmymckinney Re: Using Named Ranges to... 06-14-2013, 10:26 AM
timmymckinney Re: Using Named Ranges to... 06-14-2013, 10:40 AM
jaslake Re: Using Named Ranges to... 06-14-2013, 12:02 PM
timmymckinney Re: Using Named Ranges to... 06-14-2013, 12:15 PM
jaslake Re: Using Named Ranges to... 06-14-2013, 12:17 PM
jaslake Re: Using Named Ranges to... 06-14-2013, 04:11 PM
timmymckinney Re: Using Named Ranges to... 06-26-2013, 03:54 PM
jaslake Re: Using Named Ranges to... 06-26-2013, 04:23 PM
jaslake Re: Using Named Ranges to... 06-26-2013, 05:33 PM
timmymckinney Re: Using Named Ranges to... 06-26-2013, 06:04 PM
jaslake Re: Using Named Ranges to... 06-26-2013, 07:17 PM
timmymckinney Re: Using Named Ranges to... 06-27-2013, 11:51 AM
  1. #1
    Registered User
    Join Date
    02-27-2013
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    34

    Using Named Ranges to allow for Inserting Cells Within a VBA Coded Range

    Hello all!

    Attached is a sample of the sheet I am working on. I am pretty new to VBA and so far my code is working as intended. So far, this is what my code does: Whenever data is entered in any cell within the range K10:S41 excel will run a script which copies that cell information into other sheets (range K10:K41 copies into sheet 2 C9:C40, L10:L41 copies into sheet 3 C9:C40 etc.), next there is a script within sheets 2-9 that has automatically hides or unhides rows based on the value of cells C9:C40. So far, so good.

    Now a problem arises when I run out of rows and need to insert rows within my sheets. The way I understand it, I have written the VBA code such that the coded range doesn't change when inserting cells, thus VBA doesn't apply the code to the new cells/rows. I believe I need to change the code to refer to Named Ranges rather than "hard coded" ranges yet I don't know exactly how to do that. Also, since the formatting of sheet one corresponds with the formatting of sheets 2-9 I believe I would need to add a VBA code that would recognize whenever I insert a row on sheet 1 within the range of rows 10:41 the code also inserts corresponding rows within sheets 2-9 rows 9:40 (i.e. if I insert a row on sheet 1 in between rows 10 & 11 the code would automatically insert rows within sheets 2-9 and in between rows 9 &10). I believe this would keep my formatting problems under control.

    Recap: I would greatly appreciate it if anyone could help me: first, get my VBA code to allow me to insert rows (the range the code applies to would grow if rows were inserted within that range), and second, write a code that would insert rows as described above.

    Thanks!
    Attached Files Attached Files

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