PDA

View Full Version : Help me to complete this code



Nader
01-03-2008, 10:01 PM
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).


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


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..

Aussiebear
01-04-2008, 02:54 AM
Given my experience from your other post..... I'll be giving you a miss.

Nader
01-04-2008, 06:53 AM
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.."


http://www.xtremevbtalk.com/x_images/images/misc/progress.gif

lucas
01-07-2008, 09:26 PM
Nader,
Please read our FAQ (http://www.vbaexpress.com/forum/faq.php?). You should pay strict attention to the parts about asking for help with homework and crossposting.

See here (http://www.excelguru.ca/node/7) 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 (http://www.vbforums.com/showthread.php?p=3094597). this totally wastes a lot of people's time and is considered discourtious.