Results 1 to 7 of 7

Macro to loop untill zero value

Threaded View

coolhit Macro to loop untill zero... 02-09-2009, 04:59 PM
ravishankar Re: Macro to loop untill zero... 02-10-2009, 07:33 AM
coolhit Re: Macro to loop untill zero... 02-10-2009, 02:57 PM
coolhit Re: Macro to loop untill zero... 02-10-2009, 04:14 PM
VBA Noob Re: Macro to loop untill zero... 02-10-2009, 04:36 PM
  1. #1
    Registered User
    Join Date
    02-08-2009
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    80

    Macro to loop untill zero value

    Hi,
    I am need of some assistant, please could some help out.

    I have recorded a macro but how do i make loop over and over until it get 0 value.

    In MULTI LINE sheet there is a button which user press to activate macro.

    as the button is pressed information from MULTI LINE BREAK DOWN sheet is copied over to PREVIEW MULTI LINE LABEL sheet

    Example - MULTI LINE BREAK DOWN sheet row2
    Column A - goes to cell A2 in PREVIEW MULTI LINE LABLE
    Column B - goes to cell B3 in PREVIEW MULTI LINE LABEL
    Column C - goes to cell A1 in PREVIER MULTI LINE LABEL

    Example - MULTI LINE BREAK DOWN sheet row3
    Column A - goes to cell E2 in PREVIEW MULTI LINE LABLE
    Column B - goes to cell F3 in PREVIEW MULTI LINE LABEL
    Column C - goes to cell E1 in PREVIER MULTI LINE LABEL

    In short
    ROW2 Info goes to Left Hand side
    ROW3 Info goes to Right Hand side
    move down
    ROW4 Info goes to Left Hand Side
    ROW5 Info goes to Right Hand Side

    My MACRO codeing is

     
    Range("A1").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[1]C[2]&"" /"""
    Range("A2:B2").Select
    ActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!RC)"
    Range("B3").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-1]C&"" """
    Range("E1").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[2]C[-2]&"" /"""
    Range("E2:F2").Select
    ActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[1]C[-4])"
    Range("F3").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!RC[-4]&"" """
    Range("A4").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!RC[2]&"" /"""
    Range("A5:B5").Select
    ActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[-1]C)"
    Range("B6").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-2]C&"" """
    Range("E4").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[1]C[-2]&"" /"""
    Range("E5:F5").Select
    ActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!RC[-4])"
    Range("F6").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-1]C[-4]&"" """
    Range("A7").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-1]C[2]&"" /"""
    Range("A8:B8").Select
    ActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[-2]C)"
    Range("B9").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-3]C&"" """
    Range("E7").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[1]C[-2]&"" /"""
    Range("E8:F8").Select
    ActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[-1]C[-4])"
    Range("F9").Select
    ActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-2]C[-4]&"" """
    Range("F10").Select
    This codeing is up to 6 rows. In MULTI LINE BREAK DOWN sheet i can have to 60,80,130,etc rows worth of information. In this sheet column A has zero value then it should stop.

    Can someone please assist me. any help would be appricated.

    I have attached file.
    Attached Files Attached Files
    Last edited by VBA Noob; 02-10-2009 at 02:48 PM.

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