ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calculating a cell (https://www.excelbanter.com/excel-programming/417010-calculating-cell.html)

nabboo22

Calculating a cell
 
Hello

I need to scroll down column C until it finds "Grand Total". Afterwards
make the value of J2 equal to the value of the cell on the same row as "Grand
Total", but column P.

Thanks in advance for the help.

Regards,
John

Gary Keramidas

Calculating a cell
 
give this a try

Sub test()
Dim rngfound As Range
Dim ws As Worksheet
Set ws = Worksheets("Sheet1")

With ws.Columns("C")
Set rngfound = .Find("Grand Total", lookat:=xlWhole,
LookIn:=xlValues)
End With
If Not rngfound Is Nothing Then
With ws
.Range("J2") = .Range("P" & rngfound.Row).Value
End With
End If
End Sub


--


Gary


"nabboo22" wrote in message
...
Hello

I need to scroll down column C until it finds "Grand Total". Afterwards
make the value of J2 equal to the value of the cell on the same row as "Grand
Total", but column P.

Thanks in advance for the help.

Regards,
John





All times are GMT +1. The time now is 08:34 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com