+ Reply to Thread
Results 1 to 25 of 25

Macro that pics varied lengths of Rows

  1. #1
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Macro that pics varied lengths of Rows

    project.png

    when 1234563 is enterted all rows before 965742L must come

  2. #2
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    please give some guidance it is urgent

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Hi skashyap and welcome to the forum,

    For us to help, we must understand the question. If attach a workbook with what you have and what you expect as your answer, we have a much better time understanding. I simply don't understand what you are asking for.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    i just nee a vba where the input is 1234563 and it gives all the data across till row before 965742L
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    need*

    macro

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Hi skashyap,

    Sorry, but I must be dense. I still don't see what you want. Do you want to jump down to the gray row after putting a number in?
    In your example if you type a number in A12 it would then jump down to A19? Is this what you are looking for?

    What exactly triggers the jump? Should this only work for the specific number you give above?

  7. #7
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    there are unique numbers/alphabets in first blue cells there are names in 2nd blue cell.the jump must be till it gets the next value ignoring the value below the cell in sheet one like in sheet one i enter 1234563
    i get 1234563 61 Tiverton Road
    Andree A [email protected]
    Super is approving invoices B [email protected]
    C Super [email protected]
    D Super [email protected]

    till grey line and so on and on

  8. #8
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    ignore below and take till next value

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Hi skashyap,

    Is this an Excel question or an Access question? I'm still looking for why I don't understand the question. If it is an Access question, are you working with a form? What version of Access are you using? What view of forms are you dealing with? I'm not sure I'm much help with this question.

  10. #10
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    i am using 2010 but this is for my office which has 2003. I need the VBA either in access or excel. Will make my work easier.it must work in 2003

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Access and Excel are much different. You still haven't told me what program you are using with your question. The Forum you posted the question in is for Access. Access uses forms and the VBA code for it is much different than the VBA for Excel. I haven't understood much of any of this question yet. You have given an Excel Workbook example but now you suggest you simply need the VBA to do your task. I'm still working on understanding the task. Wow, this is hard question to figure out.

  12. #12
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    OK skashyap,

    I'm taking a wild guess on what you are asking for.

    Open the attached and run the included macro. It will ask for a number that you supply. It will then place the active cell at the bottom of the comments in column B. I sure hope this is what you want.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    it must be on sheet 1 and when 448795 is typed in a box then all columns/rows till the next number 464573

  14. #14
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    Marvin you there?

  15. #15
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Hi skashyap,

    I'm an old retired guy who only checks this forum a few hours each day. We all work for free on this forum. NZ and Seattle are in completely different time zones. It is 7:30 am Saturday as I'm reading this post. I see it is 2:30 am Sunday in NZ. I just got up and drinking my second cup of coffee. I guess the answer is "Yes I'm here", but in a different timezone.

    When you say "typed in a box", I have no idea if the box is a cell or a message box or something else. It looks like you have a poorly structured spreadsheet. It looks like you want to jump down to some account number like your "448795" as mentioned in post #13. I thought you would like my attached workbook above. Did you run the included macro in what I gave you? Did it make sense? What did it do or didn't do that you need? When you say "it must be on sheet 1", what is "it" referring to? I'm still pretty clueless on what you want and if what I've suggested helped you at all.

    Could you step back from typing in a number and describe the whole process? What kind of business or data is this involved with? What are you trying to use the spreadsheet for? How does it help what you are trying to accomplish? These questions might help us solve some problem you are having.
    Last edited by MarvinP; 08-29-2015 at 10:46 AM.

  16. #16
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    Hi Marvin sorry take your time, i have made a data input tab and removed all blank columns.So a number entered in data input column should give all the details from the other tab. The number occupies different number of rows so that is my issue. I need macro on the data input tab. just take your time and get back to me.[ATTACH]
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    Marvin you there buddy :D

  18. #18
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    just build some macros to a fresh sheet

  19. #19
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    OK skashyap try this one,

    I'm sorry but you dropped off my radar. Good thing you PMed me or I wouldn't have found your new messages. I've also been on a holiday the last few days.
    See if the attached is what you want. If you put a different number/text into the B2 cell on the Data Input sheet it will fire a macro.
    This macro will look at the first sheet in the workbook and find the input number and return the text below it to the Data Input Sheet.

    Is this what you are looking for finally? See the attached and let me know.

  20. #20
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    exactly thank you so much super Marvin

  21. #21
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    one more issue i need in xls format with macros enabled

  22. #22
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Hey skashyap,

    The file is in .xls format and the macros are enabled. You simply need to accept the warnings. The warnings are because the macros are enabled. Here it is again.
    Attached Files Attached Files

  23. #23
    Registered User
    Join Date
    08-26-2015
    Location
    Auckland,NZ
    MS-Off Ver
    2003
    Posts
    15

    Re: Macro that pics varied lengths of Rows

    Columns("B:F").Interior.TintAndShade = 0
    this part has a error

  24. #24
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    I just tried it again and it works fine on my machine. I have no idea why it wouldn't work on your system.

  25. #25
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Macro that pics varied lengths of Rows

    Hi Skashyap,

    You've private messaged me a few times saying you are only getting two columns of data moved from sheet 1 to sheet 2. You keep asking to know how to re-record the macro that does the work. The answer is that: Recording a Macro doesn't do exactly what is needed to solve your problem. I wrote the macro with more features than a recorded macro will do.

    The above being said I think I have an answer. The variable "LastColumn" seems to be the problem if you are only getting two columns moved. Change the line of:

    LastColumn = ActiveCell.Column
    to
    LastColumn = 6

    In the code in the Module and see if this doesn't fix your problem.

    The new code will then look like the below:
    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. Macro to merge and Center varied range of data in a fixed row
    By lbesley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2014, 12:39 AM
  2. [SOLVED] Transpose rows of various lengths
    By JimDandy in forum Excel General
    Replies: 11
    Last Post: 07-20-2012, 01:43 PM
  3. Replies: 9
    Last Post: 08-11-2010, 02:41 PM
  4. Comparing the lengths of 2 data rows at a time
    By bigmack in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2009, 10:18 AM
  5. Checking for pics & deleting pics in Excel worksheet
    By karthikmg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2007, 10:44 AM
  6. [SOLVED] Macro function needed for varied searches using a data filter
    By CC_rider in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-02-2005, 03:05 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