stephenedger
New Member
- Joined
- Jul 4, 2014
- Messages
- 20
Hi Excel gurus,
Here is what I have so far:
Sub Submit_Input()
'
' Copies and pastes values from "Input" to "(HIDDEN) RAW DATA"
'
Application.ScreenUpdating = False
ActiveSheet.Unprotect
'This range remains constant
Range("CA3:SY3").Select
Selection.Copy
'This is where I will be pasting the data
Sheets("(HIDDEN) RAW DATA").Visible = True
Sheets("(HIDDEN) RAW DATA").Select
'I want a vlookup to look up "Input!BZ3" in the range "(HIDDEN) RAW DATA!E8:E107"
Range("??:??").Select
'Once the row is located the copied data should be pasted in column F:QC (of the identified row)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("(HIDDEN) RAW DATA").Visible = xlVeryHidden
Sheets("Input").Select
Range("O5").Select
ActiveSheet.Protect
Application.ScreenUpdating = True
End Sub
The bit I cannot work out is how to write the vlookup (highlighted in RED). Can anybody help me please?
Thanks
Stephen
- I have an Excel 2010 spreadsheet with two main tabs "Input", and "(HIDDEN) RAW DATA".
- "Input" has a row of data (range = CA3:SY3), which I want pasted into a table in "(HIDDEN) RAW DATA".
- Cell "Input!BZ3" contains a person's name, which is variable (dropdown).
- "(HIDDEN) RAW DATA" contains a table (range = E5:QC107).
- E8:E107 contains names. I want the code to find the name in BZ3 in E8:E107, and then paste the row (Input!CA3:SY3) into the identified row.
Here is what I have so far:
Sub Submit_Input()
'
' Copies and pastes values from "Input" to "(HIDDEN) RAW DATA"
'
Application.ScreenUpdating = False
ActiveSheet.Unprotect
'This range remains constant
Range("CA3:SY3").Select
Selection.Copy
'This is where I will be pasting the data
Sheets("(HIDDEN) RAW DATA").Visible = True
Sheets("(HIDDEN) RAW DATA").Select
'I want a vlookup to look up "Input!BZ3" in the range "(HIDDEN) RAW DATA!E8:E107"
Range("??:??").Select
'Once the row is located the copied data should be pasted in column F:QC (of the identified row)
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("(HIDDEN) RAW DATA").Visible = xlVeryHidden
Sheets("Input").Select
Range("O5").Select
ActiveSheet.Protect
Application.ScreenUpdating = True
End Sub
The bit I cannot work out is how to write the vlookup (highlighted in RED). Can anybody help me please?
Thanks
Stephen