Hi All,
I'm trying to build my spreadsheet for work and you guys have been helpful with any previous questions I've posted.
My objective is to get my data from one sheet that I would have pasted in to populate into a new sheet my clicking a Button. I've used some old code which can hopefully be altered and make this happen.
In an Ideal world I would input my data in from a website into the "Omni Look-Up" sheet. I would then want this data to filter down to the selected fields I've chosen ( In the Grid). After that's done, I would like to click a button and it would copy over the cells from the filtered data into the "Master" sheet. The final thing is when I put new data in I would like it to go in the row below on the "master sheet".
I've posted the code which has been used previously so not sure if this can be tweaked.
I'm trying to build my spreadsheet for work and you guys have been helpful with any previous questions I've posted.
My objective is to get my data from one sheet that I would have pasted in to populate into a new sheet my clicking a Button. I've used some old code which can hopefully be altered and make this happen.
In an Ideal world I would input my data in from a website into the "Omni Look-Up" sheet. I would then want this data to filter down to the selected fields I've chosen ( In the Grid). After that's done, I would like to click a button and it would copy over the cells from the filtered data into the "Master" sheet. The final thing is when I put new data in I would like it to go in the row below on the "master sheet".
I've posted the code which has been used previously so not sure if this can be tweaked.
Run 1 Profit ^0 Loss (1).xlsm
1drv.ms
VBA Code:
Sub OmnipartData()
Application.ScreenUpdating = False
Dim rng As Range
Dim cell As Range
Dim rng2 As Range
Dim cell2 As Range
Set rng = Range("A2:A40")
Set rng2 = Range("F2:F10")
For Each cell In rng
CurrentTitle = cell.Value
CurrentDate = ""
For Each cell2 In rng2
CurrentTitle2 = cell2.Value
If CurrentTitle2 = CurrentTitle Then
CurrentData = cell2.Offset(0, 1)
End If
Next cell2
If CurrentData <> "" Then
cell.Offset(0, 1).Value = CurrentData
ElseIf CurrentData = "" Then
MsgBox ("Error placing data for " & CurrentTitle)
End If
Next cell
Application.ScreenUpdating = True
MsgBox "Completed"
End Sub
Last edited by a moderator: