+ Reply to Thread
Results 1 to 11 of 11

I have a code that works but how can I adjust it to activate for a different row?

  1. #1
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    I have a code that works but how can I adjust it to activate for a different row?

    I have a code that chooses the data that correlates with the condition and inputs it in another sheet, which is in the workbook, but how do I adjust the code or find a new code to make it work for the 5th row instead of the 1st row? Thanks for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,008

    Re: I have a code that works but how can I adjust it to activate for a different row?

    .
    Sheet1, B5 is an integer ... if selected ... the macro works.

    Sheet1(2), B5 is NOT an integer .. if selected ... the macro will NOT work.

    Sheet1(2), B6 IS an integer ... if selected ... the macro WILL work.



    I don't understand why you want to edit the existing macro ???

  3. #3
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Re: I have a code that works but how can I adjust it to activate for a different row?

    I found out that the problem I was having was that the data was overflowing, so would you happen to know how to make it long?

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,008

    Re: I have a code that works but how can I adjust it to activate for a different row?

    .
    Explain : "data was overflowing" and "make it long"

    What is the ultimate goal you are wanting ?

  5. #5
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Re: I have a code that works but how can I adjust it to activate for a different row?

    Sorry, the post seems like it works because it has less data than the document I'm actually trying to organize. The macro separates data that matches one condition and puts it in a new sheet but the data starts on the second row and my data starts on the 5th row because I have to put some title information before the data. So I thought that the macro didn't work on my document because the data started on the 5th row, however after trying another code that does a similar function, the error was that the data was over flowing so it was past the capacity and had to be labelled as "long" instead of "integer". I'll post that code too and maybe it can give you an understanding but this code doesn't have dim as long so I don't know how to call out the values in the cell to be long. Hopefully I described that well enough. Thanks for following up with me.


    Please Login or Register  to view this content.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,008

    Re: I have a code that works but how can I adjust it to activate for a different row?

    .
    Ok ... so if I correctly understand ... from the MAIN SHEET where all the data is located, in Column B ... beginning on row #5 and down there are repeating terms
    of "conditions".

    The goal is to create a separate sheet for each unique term ... then copy all the rows of data where the unique term appears in Col B ... to it's own named sheet.

    Is that correct ?

  7. #7
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Re: I have a code that works but how can I adjust it to activate for a different row?

    https://www.excelhow.net/split-data-...on-column.html
    Here is one of the resources I found to help with the code.

  8. #8
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Re: I have a code that works but how can I adjust it to activate for a different row?

    Sorry I think another post I posted didn't go through, but yes that's exactly what I'm trying to do. When I tried adjusting the code I noticed it was breaking and I found another resource that said it might have been because there is too much data for the way the code was written since the data I'm working with has over 60,000 rows. The code works when I have less, however it breaks with this data set, and the resources say to use "long" instead of "integer" so I'm thinking that might be the problem. Is there a way to adjust for larger sets of data?

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,008

    Re: I have a code that works but how can I adjust it to activate for a different row?

    .
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-14-2020
    Location
    California
    MS-Off Ver
    2016
    Posts
    30

    Re: I have a code that works but how can I adjust it to activate for a different row?

    thank you so much for your help and effort. Your code gave me a better guide on how to adjust it to make it work.

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,008

    Re: I have a code that works but how can I adjust it to activate for a different row?

    .
    You are welcome.

+ 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. writing vba code to fill in column of sheet, formula works vba code will not
    By pdx2245 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 05:15 PM
  2. Replies: 1
    Last Post: 07-02-2018, 07:32 PM
  3. Help to understand how this formula works so I can adjust it?!
    By Treebeardz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-14-2017, 03:43 PM
  4. Replies: 0
    Last Post: 07-05-2017, 09:36 PM
  5. [SOLVED] Deactivate code, print and activate code again
    By Immortal2014 in forum Excel General
    Replies: 4
    Last Post: 11-28-2016, 03:01 AM
  6. how can i make this code works for multiple links it only works for one link
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-12-2014, 08:38 AM
  7. How do you adjust the macro so it works on the selected row?
    By Jlosness in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2011, 12:01 PM

Tags for this Thread

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