Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data at specific positions
Hi, I want to write a macro for copying perticular cell from worksheet1 to worksheet2 at some specified position only. for instance: My data will be there only in the row 2 of Worksheet 1. I want to search which cells contains the value and copy that value in the row 1 of the worksheet2, but at the same column position. i.e. data of column a2 (Worksheet 1) will be copied at a1 position in worksheet 2. b2(Worksheet 1) to b1(Worksheet 2). g2(Worksheet 1) to g1(Worksheet 2) and so on... If any cell is blank then ignore that. Thanks, Sylvia -- Sylvia ------------------------------------------------------------------------ Sylvia's Profile: http://www.excelforum.com/member.php...o&userid=30300 View this thread: http://www.excelforum.com/showthread...hreadid=502395 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying data at specific positions
Hi Sylvia,
I have cooked up: Sub SylviasCopy() Dim intLook As Integer Dim intCol As Integer intLook = 10 For intCol = 1 To 14 If Worksheets("Sheet1").Cells(2, intCol).Value = intLook Then Worksheets("Sheet2").Cells(1, intCol).Value = intLook ' Exit For End If Next End Sub This will copy all valid values from sheet1 to sheet2 Top copy only the first valid value remove the character before Exit For Hoop this helps, Executor |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying Row Data to Specific Worksheet | Links and Linking in Excel | |||
Copying charts and their data with relative cell positions | Charts and Charting in Excel | |||
copying specific data from 1 wrksht to another | Excel Worksheet Functions | |||
Copying data to specific columns | Excel Programming | |||
Macro Help - copying specific data | Excel Programming |