Consulting

Results 1 to 4 of 4

Thread: Help me to complete this code

  1. #1

    Cool Help me to complete this code

    In the first my english language isn't very well so I use the pic to explain waht I want
    I use this code to print the data in sheet2 . Every command print a new group data ( here data has two rows and may be can take more rows).

    [vba]
    Private Sub CommandButton1_Click()

    Dim myRange1 As Range
    Dim myRange2 As Range
    Dim j As Integer
    Set myRange1 = Sheets(1).Range("A6:A100")
    Set myRange2 = Sheets(1).Range("B6:B100")
    j = Sheets(2).UsedRange.Rows.Count + 3 + Sheets(2).UsedRange.Row
    myRange1.Copy Sheets(2).Range("f" & j)
    myRange2.Copy Sheets(2).Range("g" & j)
    End Sub
    [/vba]

    I want to add a new code to my last code to complete this process:
    In the first relase this code will print group1 in sheet2 and same way in sheet3,4. In the second relase it will print the second group in the sheet2 and I want to add the number (3, of mydata to the cells of sheet3,4 ) not by print them as group and etc..
    Last edited by Nader; 01-04-2008 at 08:34 AM.

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,064
    Location
    Given my experience from your other post..... I'll be giving you a miss.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    I made some modifications on the last code, it works very well, but I want to complete this code as I explained in my previous message:
    " I want to add a new code to my last code to complete this process:
    In the first relase this code will print group1 in sheet2 and same way in sheet3,4. In the second relase it will print the second group in the sheet2 and I want to add the number (3, of mydata to the cells of sheet3,4 ) not by print them as group and etc.."


  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Nader,
    Please read our FAQ. You should pay strict attention to the parts about asking for help with homework and crossposting.

    See here for an explaination of crossposting.

    You should always post a link to where you have cross-posted. This time is especially relevant as it seems that you have been given a solution at the other website....see here. this totally wastes a lot of people's time and is considered discourtious.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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