Please help

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
 
M

marcus

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top