Vba to search and copy cells in row
Closed
PM
-
27 Apr 2010 à 03:45
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 27 Apr 2010 à 06:21
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 27 Apr 2010 à 06:21
Related:
- Vba to search and copy cells in row
- Saints row 2 cheats - Guide
- Vba find - Guide
- Spybot search and destroy - Download - Antivirus
- Search in google usa - Guide
- How to open vba in excel - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
27 Apr 2010 à 06:21
27 Apr 2010 à 06:21
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