Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default 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?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cutting & pasting from one workbook to another Janelle S[_2_] Excel Discussion (Misc queries) 5 November 1st 08 03:35 AM
Cutting first 4 digits from a cell and pasting it into an adjacent column [email protected] New Users to Excel 3 June 26th 08 09:11 PM
Cutting and Pasting with spaces pm Excel Discussion (Misc queries) 1 September 25th 07 08:32 PM
Cutting and Pasting in Excel Rev. Munchkindad Excel Discussion (Misc queries) 19 September 5th 07 08:40 PM
Formats when cutting and pasting Kayle Z Excel Discussion (Misc queries) 1 February 9th 06 03:57 AM


All times are GMT +1. The time now is 06:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"