Vba to search and copy cells in row
Closed
PM
-
Apr 27, 2010 at 03:45 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 27, 2010 at 06:21 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Apr 27, 2010 at 06:21 AM
Related:
- Vba to search and copy cells in row
- Vba case like - Guide
- Yahoo search history - Guide
- Saints row 2 cheats - Guide
- Number to words in excel formula without vba - Guide
- Safe search settings - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Apr 27, 2010 at 06:21 AM
Apr 27, 2010 at 06:21 AM
try this macro
all columns must have headings in row no. 1
all columns must have headings in row no. 1
Sub test() Dim x As Double, r As Range, y(1 To 4) As Double, cfind As Range Dim j As Integer x = InputBox("type the number you want to find e;g. 21") Set r = Range(Range("A2"), Range("A2").End(xlDown)) Set cfind = r.Cells.Find(what:=x, lookat:=xlWhole, LookIn:=xlValues) y(1) = Cells(cfind.Row, "B") y(2) = Cells(cfind.Row, "d") y(3) = Cells(cfind.Row, "f") y(4) = Cells(cfind.Row, "g") For j = 1 To 4 Worksheets("sheet2").Range("A1").Offset(0, j - 1) = y(j) Next j End Sub