Consulting

Results 1 to 2 of 2

Thread: Macro to copy value in another sheet in certain manner.

  1. #1
    VBAX Newbie
    Joined
    Oct 2007
    Posts
    1
    Location

    Macro to copy value in another sheet in certain manner.

    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

    Code:
    Range("A1").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[1]C[2]&"" /"""Range("A2:B2").SelectActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!RC)"Range("B3").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-1]C&"" """Range("E1").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[2]C[-2]&"" /"""Range("E2:F2").SelectActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[1]C[-4])"Range("F3").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!RC[-4]&"" """Range("A4").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!RC[2]&"" /"""Range("A5:B5").SelectActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[-1]C)"Range("B6").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-2]C&"" """Range("E4").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[1]C[-2]&"" /"""Range("E5:F5").SelectActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!RC[-4])"Range("F6").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-1]C[-4]&"" """Range("A7").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-1]C[2]&"" /"""Range("A8:B8").SelectActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[-2]C)"Range("B9").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[-3]C&"" """Range("E7").SelectActiveCell.FormulaR1C1 = "='MULTI LINE BREAK DOWN'!R[1]C[-2]&"" /"""Range("E8:F8").SelectActiveCell.FormulaR1C1 = "=arg('MULTI LINE BREAK DOWN'!R[-1]C[-4])"Range("F9").SelectActiveCell.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.

  2. #2
    VBAX Mentor MaximS's Avatar
    Joined
    Sep 2008
    Location
    Stoke-On-Trent
    Posts
    360
    Location
    that might solve your problem, see attached file for details

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •