Selected Answer
Here is your code stramlined a little. I have added comments to show how you can avoid endless repetitions. Another way would be to construct loops.
Sub GetData()
' declare your variables
Dim WsInput As Worksheet ' Worksheets("Inputform")
Dim WsDocs As Worksheet ' Worksheets("shippingpapers")
Dim Rng As Range
' assign objects to the declared variables
Set WsInput = Worksheets("Inputform")
Set WsDocs = Worksheets("shippingpapers")
' start a "With" block, terminated by "End With"
' within the block all expressions starting with a period refer to
' the object specified in the With statement
' Careful! Where the leading period is omitted the expression refers
' to the ActiveSheet. Range("A3") is different from .Range("A3")
With WsInput
Set Rng = WsDocs.Range("B3, P3, B29, P29, B45, P45, B61, P61")
Rng.Value = .Range("F4").Value
Rng.Offset(, 4).Value = .Range("F6").Value
Rng.Offset(2).Value = .Range("F8").Value
Rng.Offset(2, 4).Value = .Range("F10").Value
Rng.Offset(4).Value = .Range("F8").Value
Rng.Offset(4).Value = .Range("F14").Value
Rng.Offset(9).Value = .Range("F19").Value
End With
' as a broad rule,
' use syntax for addressing cells to address cells
' cells are addressed by their coordinates (numbers)
' the syntax is Ws.Cells([Row number], [Column number or ID])
' use syntax for addressing ranges only to address ranges
' ranges are addressed by their names (text strings)
' the syntax is Ws.Range("Range name")
' in the absence of given names, Excel's VBA concatenates
' range names from cell coordinates
If WsInput.Cells(12, "F").Value = "Ground" Then
WsDocs.Cells(4, "K").Value = "XXXXX"
End If
End Sub
Your IF styatement didn't work because Excel didn't recognize your syntax for addressing worksheets. It really helps if you declare your objects before you start using them. Microsoft, in their constant effort to make things easier, started an effort (by means of VBE's macro recorder) to conflate Sheets and Worksheets. These are two different collections. It really makes no material difference which one you use - till the day it does make a difference. According to MS (presumed) statistics 98% of all programmers will never reach that day, 1% will know the difference by then, and the other 1% aren't important (to Microsoft). I recommend to stick with what you know: When you declare Dim Ws As Worksheet (you can't declare it As Sheet!) don't assign a Sheet to it but a Worksheet.