Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Thank you for help. This is what I wanted. Now what would be a new VBA macro
if I wanted to copy / paste the all rows that contain "200". These rows come after the rows that contain "199" ? Thanks, Like this: 199 199 199 200 200 200 "Dave Peterson" wrote: Run this against a copy of your workbook--it does what you describe, but I'm not sure that's what you want: Option Explicit Sub testme() Dim wks As Worksheet Dim FoundCell As Range Dim myStr As String myStr = "199" Set wks = ActiveSheet With wks With .Range("a:a") Set FoundCell = .Cells.Find(What:="199", _ After:=.Cells(1), LookIn:=xlValues, _ LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious, _ MatchCase:=False) End With If FoundCell Is Nothing Then MsgBox myStr & " wasn't found" Else .Range("a1", FoundCell).Value = 199 End If End With End Sub Jeff wrote: Hello, I need a VBA Macro to copy / paste the # "199" in column "A". The range would have to be from "A1" to the last row in column "A" that contains "199" Thanks, -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Setting source data range with Charts | Charts and Charting in Excel | |||
Auto x range start value, xy charts | Charts and Charting in Excel | |||
How do you change the size of a range of cells in a column/row | Charts and Charting in Excel | |||
Achieving Range with a trendline | Charts and Charting in Excel | |||
Extending a Chart Data Series from an Array - Can it be done? | Charts and Charting in Excel |