Formula to copy data
Solved/Closed
swittlin
venkat1926
- Posts
- 1
- Registration date
- Wednesday March 10, 2010
- Status
- Member
- Last seen
- March 10, 2010
venkat1926
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Related:
- Formula to copy data
- Excel formula to transfer data between worksheets - Guide
- Replace 'sheet' reference in a formula (not copy data, but get averages) ✓ - Forum - Excel
- Excel formula to move data from one cell to another automatically ✓ - Forum - Excel
- Excel formula to copy data from one sheet to another based on criteria - Forum - Excel
- Excel data validation formula if statement - Forum - Excel
1 reply
venkat1926
Mar 10, 2010 at 11:02 PM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Mar 10, 2010 at 11:02 PM
your database is not clear. you said some dots . I suppose the no. of dots represent the score or soemthing.
what is meant by "return all the info i"
I suppose you want those rows to be copied in anoher sheet e.g. sheet 2
let us see. sample database is like ths in sheet1
hdng1 hdng2 hdng3 hdng4
1 ……… ……… ………
2 ……… ……… ………
3 ……… ……… ………
2 ……… ……… ………
1 ……… ……… ………
1 ……… ……… ………
2 ……… ……… ………
3 ……… ……… ………
try this macro and see whether it solves your problem
what is meant by "return all the info i"
I suppose you want those rows to be copied in anoher sheet e.g. sheet 2
let us see. sample database is like ths in sheet1
hdng1 hdng2 hdng3 hdng4
1 ……… ……… ………
2 ……… ……… ………
3 ……… ……… ………
2 ……… ……… ………
1 ……… ……… ………
1 ……… ……… ………
2 ……… ……… ………
3 ……… ……… ………
try this macro and see whether it solves your problem
Sub test() Dim r As Range, rfind As Range Dim anchor As Range, j As Double, dest As Range Dim add As String Worksheets("sheet2").Cells.Clear Worksheets("sheet1").Activate Set r = ActiveSheet.UsedRange.Columns("A:A") Set anchor = Range("A1") j = InputBox("type the number which you want to refer in the first column") Set rfind = r.Cells.Find(what:=j, lookat:=xlWhole, after:=anchor) If rfind Is Nothing Then Exit Sub add = rfind.Address rfind.EntireRow.Copy Set dest = Worksheets("sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) dest.PasteSpecial Do Set rfind = r.Cells.FindNext(rfind) If rfind Is Nothing Then Exit Do If rfind.Address = add Then Exit Do rfind.EntireRow.Copy Set dest = Worksheets("sheet2").Cells(Rows.Count, "A").End(xlUp).Offset(1, 0) dest.PasteSpecial Loop Application.CutCopyMode = False MsgBox "macro over" End Sub