ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get row number using input box (https://www.excelbanter.com/excel-programming/398361-get-row-number-using-input-box.html)

Allan

Get row number using input box
 
I need to get the row number from a sheet by using an input box
type = 8 ?
Once I have the row it will be used to copy selected columns to another sheet.

Right now I' using this:

Sheets("Tickler").Select
myvar = Application.InputBox("Enter Line number to retrieve Row", "OPTIONS", _
Type:=1)

Range(Cells(myvar, 16), Cells(myvar, 22)).Select
Selection.Copy
....
AH

joel

Get row number using input box
 
I text box returns a string and you need a number

from
Range(Cells(myvar, 16), Cells(myvar, 22)).Select
Selection.Copy
to
Range(Cells(val(myvar), "P"), Cells(val(myvar), "V")).Select
Selection.Copy
"Allan" wrote:

I need to get the row number from a sheet by using an input box
type = 8 ?
Once I have the row it will be used to copy selected columns to another sheet.

Right now I' using this:

Sheets("Tickler").Select
myvar = Application.InputBox("Enter Line number to retrieve Row", "OPTIONS", _
Type:=1)

Range(Cells(myvar, 16), Cells(myvar, 22)).Select
Selection.Copy
...
AH


Gary''s Student

Get row number using input box
 
Type 8 is useful if you want the user to do the selection with the mouse
rather than the keyboard:

Sub dural()
Dim r As Range, s As String
s = "select cells to copy with mouse "
Set r = Application.InputBox(s, Type:=8)
r.Select
Selection.Copy
End Sub

--
Gary''s Student - gsnu200747


"Allan" wrote:

I need to get the row number from a sheet by using an input box
type = 8 ?
Once I have the row it will be used to copy selected columns to another sheet.

Right now I' using this:

Sheets("Tickler").Select
myvar = Application.InputBox("Enter Line number to retrieve Row", "OPTIONS", _
Type:=1)

Range(Cells(myvar, 16), Cells(myvar, 22)).Select
Selection.Copy
...
AH


Allan

Get row number using input box
 
Thanks, using the mouse option was just what I was looking for.


--
AH


"Gary''s Student" wrote:

Type 8 is useful if you want the user to do the selection with the mouse
rather than the keyboard:

Sub dural()
Dim r As Range, s As String
s = "select cells to copy with mouse "
Set r = Application.InputBox(s, Type:=8)
r.Select
Selection.Copy
End Sub

--
Gary''s Student - gsnu200747


"Allan" wrote:

I need to get the row number from a sheet by using an input box
type = 8 ?
Once I have the row it will be used to copy selected columns to another sheet.

Right now I' using this:

Sheets("Tickler").Select
myvar = Application.InputBox("Enter Line number to retrieve Row", "OPTIONS", _
Type:=1)

Range(Cells(myvar, 16), Cells(myvar, 22)).Select
Selection.Copy
...
AH



All times are GMT +1. The time now is 12:50 AM.

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