• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extract data and Edit data

marreco

Member
Hi.

I have sheet "Edit" and sheet "Data_Base"

I need enter inside sheet "Edit" value in C6, this value is return all data from sheet "Data_Base" to sheet "Edit" then i change any value in column E ("Cond.") in side sheet "Edit" after run macro edit this values in in column E ("Cond.") in side sheet "Data_Base"
 

Attachments

  • ExtractEditSave.xlsb
    171.1 KB · Views: 6

Hi !

Your description leads to a gas factory code !

♪ Better, easier, faster ♫ (lyrics from Daft Punk !) is
to directly filter and edit worksheet Data_Base
 
Like it's hard, ♫ smarter ♪ is to directly edit Data_Base worksheet !

If you need to display only the rows of a specific data,
just use a filter on its column …

No needs a single codeline, so it's easy for you ‼ :cool:

Your original post is like from first floor you take upstairs
until last floor, then you call the elevator to descend to ground floor ! :rolleyes:
 
Last edited:
I need eddit a value anothe sheet.
Code:
Sub I_cannotDoIt()
Dim tbl As ListObject

Set tbl = Worksheets("Data_Base").ListObjects("ESTOQUE")
Application.ScreenUpdating = 0
    With Worksheets("Test")
        .Range("A:G").Delete
    End With
    tbl.AutoFilter.ShowAllData
    tbl.Range.AutoFilter Field:=5, Criteria1:=Worksheets("Edit").Range("C6")
    tbl.DataBodyRange.Copy Destination:=Worksheets("Test").Range("A2")
    With Worksheets("Test")
        .Range("C:D,J:X").Delete
        .Range("A1").Value = "Codigo"
        .Range("B1").Value = "Data"
        .Range("C1").Value = "Orc"
        .Range("D1").Value = "Cond"
        .Range("E1").Value = "Qtd"
        .Range("F1").Value = "Pago"
        .Range("G1").Value = "Descrição do produto"
        .Columns.AutoFit
    End With
    Call PartII
Application.ScreenUpdating = 1
End Sub

Sub HelpMe()
Dim a As Integer
    Sheets("Edit").Range("B9:H2000").Delete
    a = Sheets("Test").Range("A" & Rows.Count).End(xlUp).Row
    Sheets("Test").Range("A2:G" & a).Copy
    Sheets("Edit").Range("B9").PasteSpecial xlPasteValues
End Sub
My code not insert in data edited in sheet "Data_Base"
 

For this useless way, you can insert in Data_Base worksheet a new column
for row ID, could be for example the row number, to be copied with data to
Edit worksheet, so when you need to copy back data to source worksheet
you already know its row number …
If each source row has already an unique data as an ID, you just have to
search this ID in source worksheet to find the row where paste edited data …
 
I1m confuse how implente update antother sheet same row (not add row another sheet).
Imagine:
typing on a tab and update the same record in another tab
 

Attachments

  • typing_ tab_update_another.jpg
    typing_ tab_update_another.jpg
    271.1 KB · Views: 3

So in this case with the same row number there is no difficulty !

For example with Copy method (see in VBA inner help) :​
Code:
SourceWorksheet.Cells(Row, Column).Copy DestinationWorksheet.Cells(Row, Column)
 
Back
Top