Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
need a macro
i want to copy cell from o awork sheet to a spacific work sheet if one cell = a spacific word eg bars, maintinance, kings,reef i want it to copy it to a sheet called that spacific work in a new work book i wrote the following macro Sheets("order Sheet").Select If Range("E3") = "1" Then Range("a3:o3").Select Selection.Copy End If If Range("e4") = "1" Then Range("a3:o3").Select Selection.Copy End If Application.Run "copyfromordersheetadmin" end sub Public Sub Copyfromordersheetadmin() Windows("purchase orders.xls").Activate ActiveWindow.WindowState = xlNormal Sheets("Order Sheet").Select Selection.Copy ' Sheets("Stock Record").Select ' Selection.SpecialCells(xlCellTypeLastCell).Select ' ActiveCell.Offset(1, -11).Select gotolastcelladmin Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=False 'Selection.SpecialCells(xlCellTypeLastCell).Select Range("a1").Select End Sub Public Sub gotolastcelladmin() Windows("department orders.xls").Activate ActiveWindow.WindowState = xlNormal Sheets("admin").Select ActiveSheet.Cells(1, 1).Select Set tbl = ActiveCell.CurrentRegion tbl.Offset(tbl.Rows.Count, 0).Resize(tbl.Rows.Count - (tbl.Rows.Count - 1), tbl.Columns.Count - (tbl.Columns.Count - 1)).Select End Sub this worked and i wrote a macro for each of the words and then created a macro that would run all of these macros but it copied to to all sheets not just the sheet that i told it to copy it to ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copying cells between sheets in a workbook | Excel Discussion (Misc queries) | |||
Copying cells from one workbook to another | Excel Worksheet Functions | |||
Automatically copying cells to another workbook | Setting up and Configuration of Excel | |||
How do I revert cells to blank automatically on spacific days? | Excel Discussion (Misc queries) | |||
how do i get a pop up with reminders of things to do at spacific . | Excel Discussion (Misc queries) |