string in a range...

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
369
Office Version
  1. 2010
Platform
  1. Windows
Hi there, I have a userform which grabs data from a range when triggered. The userform is a 'generic' form which I hope to use to edit several rows of data (all formatted in the same way)

Each input box in the userform imports data from the relevant cell in the row and I need it to save back when the user clicks update... For example, on row12, the update would be:

Code:
Private Sub UpdateSheetButton_Click()

Range("M12").Value = Me.Value1.Value
Range("M13").Value = Me.Value2.Value
Range("M14").Value = Me.Value3.Value
Range("M15").Value = Me.Value4.Value
Unload Me
End Sub

I am also importing another cell into the userform which is just the row number (ie. 12) and I was hoping I could substitute that into the code as a string...

Please forgive my ignorance, but I come from a php programming background where I would just use
Code:
$rownumber =  Range("AE12").Value
Range("M'echo $rownumber;'").Value = Me.Value1.Value

I hope you understand what I'm trying to do here and that there is an easy solution for this

Thanks
 
Last edited:

Some videos you may like

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hi,

You could test the following :

Code:
Range("M" & $rownumber).Value = Me.Value1.Value

HTH
 

Sektor

Well-known Member
Joined
May 6, 2011
Messages
2,834
Code:
rownumber =  Range("AE12").Value
Cells(rownumber, "M").Value = Me.Value1.Value
 

RobbieC

Active Member
Joined
Dec 14, 2016
Messages
369
Office Version
  1. 2010
Platform
  1. Windows
Brilliant, thanks! Works a treat!
 

Sektor

Well-known Member
Joined
May 6, 2011
Messages
2,834
hi.gif
 

Watch MrExcel Video

Forum statistics

Threads
1,122,657
Messages
5,597,391
Members
414,142
Latest member
Banyangt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top