Please help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am trying to find a month on a dat sheet to paste the value of a cell from
my totals sheet. i cant figure it out.

any help would greatly appreciated

Public Sub InsuranceForward(ByVal Month As String)
Dim wslist As Worksheet 'Worksheet with list
Dim rngToSearch As Range
Dim rngfound As Range

'Edit to your worksheet name
Set wslist = wksData
Month = ActiveSheet.Range("B5")
Set rngToSearch = wksData.Range("AF2:Af13")

Set rngfound = rngToSearch.Find(What:=Month)

wksTotals.Range("I31").Copy Destination:=rngfound.Offset(0, 1)

End Sub
 
Hi

A minor change to your code should do it. Change the sheet name to
suit.

Take care

Marcus

Sub InsuranceForward()

Dim wslist As Worksheet 'Worksheet with list
Dim RngToSearch As Range
Dim Rngfound As Range
Dim WksTotals As Worksheet
Dim Month As String
'Change the sheet name to suit.
Set WksTotals = Worksheets("Sheet1")
Month = Range("B5").Value
Set RngToSearch = Range("AF2:AF13")
Set Rngfound = RngToSearch.Find(What:=Month)
WksTotals.Range("I31").Copy Destination:=Rngfound.Offset(0, 1)

End Sub
 
Back
Top