Excel VBA Macro coding/ data look up
Closed
keendiggz
-
27 Jun 2011 à 13:47
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 28 Jun 2011 à 20:35
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 28 Jun 2011 à 20:35
Related:
- Excel VBA Macro coding/ data look up
- Excel vba find - Guide
- How to copy data from one excel sheet to another - Guide
- Export data from excel - Guide
- Vba excel mac - Guide
- Unlock excel vba and excel macros - Guide
3 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
27 Jun 2011 à 22:31
27 Jun 2011 à 22:31
main data is in sheet 1
the sheet red is also available.
then try this macrof
the sheet red is also available.
then try this macrof
Sub test()
Dim datarange As Range, filt As Range, crtra As String
With Worksheets("sheet1")
crtra = InputBox("type the criteria e.g. red")
Set datarange = .Range("A1").CurrentRegion
datarange.AutoFilter field:=Range("E1").Column, Criteria1:=crtra
Set filt = datarange.SpecialCells(xlCellTypeVisible)
filt.Copy
With Worksheets(crtra)
.Range("A1").PasteSpecial
End With
datarange.AutoFilter
End With
End Sub
Venkat, Thanks for your help, unfortunately this is not quite what i needed.
I'm not looking for any sort of user form, I want it to auto update from worksheets. Basically I have one sheet with all my info, and within that sheet there are different file types. Let's use the example of a column labeled 'file type'. within that column there will be values for each entry reports, to requisitions, to revised reports.. i will then have a corresponding sheet titled each of those values.
if an entry says "reports" in that column, i want the whole row to be copied and pasted into the "reports" worksheet WITHOUT overwriting previous data (ie. add new data beneath)
Thanks in advance to any insight you may have.
I'm not looking for any sort of user form, I want it to auto update from worksheets. Basically I have one sheet with all my info, and within that sheet there are different file types. Let's use the example of a column labeled 'file type'. within that column there will be values for each entry reports, to requisitions, to revised reports.. i will then have a corresponding sheet titled each of those values.
if an entry says "reports" in that column, i want the whole row to be copied and pasted into the "reports" worksheet WITHOUT overwriting previous data (ie. add new data beneath)
Thanks in advance to any insight you may have.
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
28 Jun 2011 à 20:35
28 Jun 2011 à 20:35
there is no user form in my solution.. this is only a macro
instead of pasting on range("A1") in worksheets(ctra)
use the statement
this will paste after the last row in sheet who name is defined by ctra.
instead of pasting on range("A1") in worksheets(ctra)
use the statement
With Worksheets(crtra) .cells(rows.count.A"").end(xlup).offset(1,0).PasteSpecial End With
this will paste after the last row in sheet who name is defined by ctra.