ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Transpond text to public statement (https://www.excelbanter.com/excel-programming/396920-transpond-text-public-statement.html)

KentAE

Transpond text to public statement
 
Hi
In follwing code myGate = CS and the statement nCs =39445. In the Find
method I want that myDayNr = 39445, not "nCS". How to do?

Public nCS As Long
Sub X()
'----
myDayNr = "n" & myGate
'----

Cells.Find(myDayNr, After:=ActiveCell, LookIn:=xlValues,
LookAt:=xlWhole, _
SearchOrder:=xlRow, SearchDirection:=xlNext).Activate
End Sub
--
Officebyggaren
Kent Älmegran

Vergel Adriano

Transpond text to public statement
 
I assume nCS is a named range referring to one cell? try it this way:

Cells.Find(Range(myDayNr).Value, After:=ActiveCell, LookIn:=xlValues,
LookAt:=xlWhole, _
SearchOrder:=xlRow, SearchDirection:=xlNext).Activate



--
Hope that helps.

Vergel Adriano


"KentAE" wrote:

Hi
In follwing code myGate = CS and the statement nCs =39445. In the Find
method I want that myDayNr = 39445, not "nCS". How to do?

Public nCS As Long
Sub X()
'----
myDayNr = "n" & myGate
'----

Cells.Find(myDayNr, After:=ActiveCell, LookIn:=xlValues,
LookAt:=xlWhole, _
SearchOrder:=xlRow, SearchDirection:=xlNext).Activate
End Sub
--
Officebyggaren
Kent Älmegran


KentAE

Transpond text to public statement
 
No, nCS is a Public statement and the value is 39455 (jan 8 2008) and is
piced up from an userform. Now I need to find ut where in tha active sheet I
can find 39455.
Thank´s in acvance for all help!
--
Officebyggaren
Kent Älmegran


"Vergel Adriano" skrev:

I assume nCS is a named range referring to one cell? try it this way:

Cells.Find(Range(myDayNr).Value, After:=ActiveCell, LookIn:=xlValues,
LookAt:=xlWhole, _
SearchOrder:=xlRow, SearchDirection:=xlNext).Activate



--
Hope that helps.

Vergel Adriano


"KentAE" wrote:

Hi
In follwing code myGate = CS and the statement nCs =39445. In the Find
method I want that myDayNr = 39445, not "nCS". How to do?

Public nCS As Long
Sub X()
'----
myDayNr = "n" & myGate
'----

Cells.Find(myDayNr, After:=ActiveCell, LookIn:=xlValues,
LookAt:=xlWhole, _
SearchOrder:=xlRow, SearchDirection:=xlNext).Activate
End Sub
--
Officebyggaren
Kent Älmegran



All times are GMT +1. The time now is 01:10 PM.

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