Ok, I'm building a little bit of code for users to fill in a little excel form, submit and then it automatically populates another sheet in the workbook.
Where I am falling down at the moment is in referencing the column. I can find the correct place. But the reference is as a number rather than a letter, so I either need to change this, or change the way that I reference the cell to post the value to.
Anyway here is the code at the moment
Where I am falling down at the moment is in referencing the column. I can find the correct place. But the reference is as a number rather than a letter, so I either need to change this, or change the way that I reference the cell to post the value to.
Anyway here is the code at the moment
Code:
Private Sub Submit_Click()
Dim wsf As Worksheet, _
p As String, _
ste As Range, _
ste1 As Long, _
rng As Range, _
rng1 As Long
Set wsf = Sheets("Fleet")
p = "Week" & wsf.Range("E5")
With Sheets(p).Range("A3:AE3")
Set ste = .Find(wsf.Range("E3"))
ste1 = ste.Column
End With
Y = 7
'Do Until Y = 29
On Error Resume Next
With Sheets(p).Range("A1:A200")
Set rng = .Find(wsf.Range("A" & Y))
rng1 = rng.Row
End With
MsgBox (ste1 & rng1)
MsgBox (wsf.Range("E" & Y))
'Sheets(p).Range(ste1 & rng1) = wsf.Range("E" & Y)
'Y = Y + 2
'Loop
End Sub