Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
vb code question
I have numeric data in column A which which I want to find and then copy each
row that contains this data in columns A-C. In other words if rows 6 through 21 contain the value 7760 then through VB code I want to copy the data in rows 6-21 and columns A-C. I took a stab at the code below but it's giving me a data mismatch error on the first part. I'm new to coding so any help you can provide would be greatly appreciated. Many thanks! Sub GetData() Dim rng As Range Set rng = Range("A:C").Find(What:=7760, _ After:=ActiveCell, _ LookIn:=xlFormulas, _ LookAt:=xlPart, _ SearchOrder:=xlByRows, _ SearchDirection:=xlNext, _ MatchCase:=False, _ SearchFormat:=False) ActiveCell.Select ActiveCell.Offset(0, 3).Select Dim LastCellInN As Range With ActiveSheet Set LastCellInN = .Cells(.Rows.Count, "N").End(xlUp) .Range("A3").Formula = "=N3/" & LastCellInN.Address(0, 0) End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vb code question | Excel Discussion (Misc queries) | |||
VB Code Question | Excel Programming | |||
VBA code question?! | Excel Programming | |||
Code Question | Excel Programming |