Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have no experience with macros @ all. Really need your help.
I have a spreedsheet that I sort by column A, depending on what code is in column A, I need the data adjacent to it copied to another sheet. Example: SHEET "OPEN" COLUMN A COLUMN B COLUMN C COLUMN D 09 $25,000 ABC VENDOR 11/2/08 13 $55.00 XYZ VENDOR 10/19/08 IF COLUMN A ON WORKSHEET "OPEN" IS = 09 THEN I NEED EVERYTHING IN THE ROW ADJACENT TO IT (COLUMN B THRU D) COPIED TO SHEET "SMITH". CAN ANYONE HELP ME. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I wrote a similar macro yesterday for another post..
Open the workbook Press ALT-11 to open VB Editor Click on your workbook name on the left Click on Insert-Module Paste the code below Press the PLAY button on the top Go to your workbook and verify Sub copyit() 'IF COLUMN A ON WORKSHEET "OPEN" IS = 09 THEN I NEED EVERYTHING IN THE ROW 'ADJACENT TO IT (COLUMN B THRU D) COPIED TO SHEET "SMITH". Dim shName As String Dim MyRange As Range Dim sh As Worksheet Set MyRange = Worksheets("Open").Range("A1:A" & Worksheets("Open").Cells(Rows.Count, "A").End(xlUp).Row) For Each c In MyRange 'If Col A contains numbers then replace "09" with 9 below If c.Value = "09" Then c.EntireRow.Copy _ Destination:=Sheets("Smith").Cells(Sheets("Smith") .Cells(Rows.Count, "A").End(xlUp).Row + 1, 1) End If Next End Sub "Lin1981" wrote: I have no experience with macros @ all. Really need your help. I have a spreedsheet that I sort by column A, depending on what code is in column A, I need the data adjacent to it copied to another sheet. Example: SHEET "OPEN" COLUMN A COLUMN B COLUMN C COLUMN D 09 $25,000 ABC VENDOR 11/2/08 13 $55.00 XYZ VENDOR 10/19/08 IF COLUMN A ON WORKSHEET "OPEN" IS = 09 THEN I NEED EVERYTHING IN THE ROW ADJACENT TO IT (COLUMN B THRU D) COPIED TO SHEET "SMITH". CAN ANYONE HELP ME. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro - copy a range and paste it in a new sheet 12 times | Excel Worksheet Functions | |||
how to create a copy/paste special/transpose macro? | Excel Discussion (Misc queries) | |||
How to create a macro which performs a copy-and-paste task every 5mins after data is refreshed from web page? | Excel Worksheet Functions | |||
Copy and Paste Macro for front totals sheet | Excel Discussion (Misc queries) | |||
I need formula help or create a macro to copy and paste value only | Excel Discussion (Misc queries) |