Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please Cutting and pasting based on cell value
Help please, I am trying to automate the cutting and pasting of lines
based on a value of a cell. I have a spreadsheet that is partly automated that sorts contact data and will copy a selected range into a new spreadsheet. What I want to try to do is select rows within this that have a status = good and paste them only to my template spreadsheet. I have worked out how to automate the file saving with a date and timestamp but not how to make the selection and invoke a message box to confirm the the selection. Layout is : Date/Name/Company/Address/Product/Status/Ship/Product/Qty/ +5 columns with Sales Data My template just needs the first nine columns for an import process and the rest are disregarded. Any help at all would be grately appreciated Many thanks Mike |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please Cutting and pasting based on cell value
So you want the code to go down some column and when it sees the word
"good" to cut that row, and paste it onto the template sheet? If so, what column are goods in? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please Cutting and pasting based on cell value
|
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help Please Cutting and pasting based on cell value
Try the following:
Sub templatecopier() mainsheet = ActiveSheet.Name Dim intcounter As Integer Dim lastrow As Integer lastrow = ActiveSheet.UsedRange.Rows.Count intcounter = 2 Cells(intcounter, 6).Select Do Until intcounter = lastrow + 1 If ActiveCell.Value = "good" Then ActiveCell.EntireRow.Copy Sheets("Template").Select Range("A1").Select Selection.Insert Shift:=xlDown Sheets(mainsheet).Select End If intcounter = intcounter + 1 Cells(intcounter, 6).Select Loop Application.CutCopyMode = False Range("A1").Select End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Cutting & pasting from one workbook to another | Excel Discussion (Misc queries) | |||
Cutting first 4 digits from a cell and pasting it into an adjacent column | New Users to Excel | |||
Cutting and Pasting with spaces | Excel Discussion (Misc queries) | |||
Cutting and Pasting in Excel | Excel Discussion (Misc queries) | |||
Formats when cutting and pasting | Excel Discussion (Misc queries) |