ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   A small problem for you but big for me! (https://www.excelbanter.com/excel-discussion-misc-queries/32636-small-problem-you-but-big-me.html)

Michael

A small problem for you but big for me!
 
Dim Msg, Style, Title, Help, Ctxt, response, MyString 'Deklarerer msgbox

'If a user push a button this happens:

Msg = "Do you want to change the input ?"
Style = vbOKCancel + vbInformation + vbDefaultButton2
Title = "Input"

response = MsgBox(Msg, Style, Title)

If response = vbOK Then

MaterialRow = 0 'the column is called material
MaterialCol = 0
MaterialRow = ActiveSheet.Range("Material").Row
MaterialCol = ActiveSheet.Range("Material").Column '

response = InputBox("Please enter the row number", "Number Entry") 'The
user can choose row number

MaterialRow = response

Load FrmMaterial
FrmMaterial.TextBoxOldMaterial.Text = ActiveSheet.Range("f12").Value
'Instead of "f12" should i manage to put in MaterialRow, but i cant,
what's wrong?
FrmMaterial.Show

Else
End If

I want this to give me the contents of the cell MaterialRow no mather if its
a number or text.Help!!
--
Nil Satis Nisi Optimum

Kassie

Hi Michael

In your inputbox you define the response as a number (row number). To use
this info, you will have to concatenate it with Col number, which is alpha.
MaterialCol & MaterialRow. However, you set MaterialCol to "0". Instead,
set it to "". I would also define it properly with Dim and As String

"Michael" wrote:

Dim Msg, Style, Title, Help, Ctxt, response, MyString 'Deklarerer msgbox

'If a user push a button this happens:

Msg = "Do you want to change the input ?"
Style = vbOKCancel + vbInformation + vbDefaultButton2
Title = "Input"

response = MsgBox(Msg, Style, Title)

If response = vbOK Then

MaterialRow = 0 'the column is called material
MaterialCol = 0
MaterialRow = ActiveSheet.Range("Material").Row
MaterialCol = ActiveSheet.Range("Material").Column '

response = InputBox("Please enter the row number", "Number Entry") 'The
user can choose row number

MaterialRow = response

Load FrmMaterial
FrmMaterial.TextBoxOldMaterial.Text = ActiveSheet.Range("f12").Value
'Instead of "f12" should i manage to put in MaterialRow, but i cant,
what's wrong?
FrmMaterial.Show

Else
End If

I want this to give me the contents of the cell MaterialRow no mather if its
a number or text.Help!!
--
Nil Satis Nisi Optimum


Michael

Thanks Kassie!

"Kassie" wrote:

Hi Michael

In your inputbox you define the response as a number (row number). To use
this info, you will have to concatenate it with Col number, which is alpha.
MaterialCol & MaterialRow. However, you set MaterialCol to "0". Instead,
set it to "". I would also define it properly with Dim and As String

"Michael" wrote:

Dim Msg, Style, Title, Help, Ctxt, response, MyString 'Deklarerer msgbox

'If a user push a button this happens:

Msg = "Do you want to change the input ?"
Style = vbOKCancel + vbInformation + vbDefaultButton2
Title = "Input"

response = MsgBox(Msg, Style, Title)

If response = vbOK Then

MaterialRow = 0 'the column is called material
MaterialCol = 0
MaterialRow = ActiveSheet.Range("Material").Row
MaterialCol = ActiveSheet.Range("Material").Column '

response = InputBox("Please enter the row number", "Number Entry") 'The
user can choose row number

MaterialRow = response

Load FrmMaterial
FrmMaterial.TextBoxOldMaterial.Text = ActiveSheet.Range("f12").Value
'Instead of "f12" should i manage to put in MaterialRow, but i cant,
what's wrong?
FrmMaterial.Show

Else
End If

I want this to give me the contents of the cell MaterialRow no mather if its
a number or text.Help!!
--
Nil Satis Nisi Optimum


Bernie Deitrick

Michael,

FrmMaterial.TextBoxOldMaterial.Text = _
ActiveSheet.Range("F" & MaterialRow ).Value

HTH,
Bernie
MS Excel MVP


"Michael" wrote in message
...
Dim Msg, Style, Title, Help, Ctxt, response, MyString 'Deklarerer msgbox

'If a user push a button this happens:

Msg = "Do you want to change the input ?"
Style = vbOKCancel + vbInformation + vbDefaultButton2
Title = "Input"

response = MsgBox(Msg, Style, Title)

If response = vbOK Then

MaterialRow = 0 'the column is called material
MaterialCol = 0
MaterialRow = ActiveSheet.Range("Material").Row
MaterialCol = ActiveSheet.Range("Material").Column '

response = InputBox("Please enter the row number", "Number Entry")

'The
user can choose row number

MaterialRow = response

Load FrmMaterial
FrmMaterial.TextBoxOldMaterial.Text = ActiveSheet.Range("f12").Value
'Instead of "f12" should i manage to put in MaterialRow, but i cant,
what's wrong?
FrmMaterial.Show

Else
End If

I want this to give me the contents of the cell MaterialRow no mather if

its
a number or text.Help!!
--
Nil Satis Nisi Optimum




Michael

Thanks Bernie, that was a easy one, it works perfect :-)
--
Nil Satis Nisi Optimum


"Bernie Deitrick" wrote:

Michael,

FrmMaterial.TextBoxOldMaterial.Text = _
ActiveSheet.Range("F" & MaterialRow ).Value

HTH,
Bernie
MS Excel MVP


"Michael" wrote in message
...
Dim Msg, Style, Title, Help, Ctxt, response, MyString 'Deklarerer msgbox

'If a user push a button this happens:

Msg = "Do you want to change the input ?"
Style = vbOKCancel + vbInformation + vbDefaultButton2
Title = "Input"

response = MsgBox(Msg, Style, Title)

If response = vbOK Then

MaterialRow = 0 'the column is called material
MaterialCol = 0
MaterialRow = ActiveSheet.Range("Material").Row
MaterialCol = ActiveSheet.Range("Material").Column '

response = InputBox("Please enter the row number", "Number Entry")

'The
user can choose row number

MaterialRow = response

Load FrmMaterial
FrmMaterial.TextBoxOldMaterial.Text = ActiveSheet.Range("f12").Value
'Instead of "f12" should i manage to put in MaterialRow, but i cant,
what's wrong?
FrmMaterial.Show

Else
End If

I want this to give me the contents of the cell MaterialRow no mather if

its
a number or text.Help!!
--
Nil Satis Nisi Optimum






All times are GMT +1. The time now is 11:09 AM.

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