![]() |
Output Text in specific place
this is pretty easy question but i was wondering how do you output a specific text in a specific place the specific place will be determined by a variable that i previously defined, i.e. the end of a set number of rows. the set number of rows are variable each time, hence i need to use a variable thanks -- narutard ------------------------------------------------------------------------ narutard's Profile: http://www.excelforum.com/member.php...o&userid=25111 View this thread: http://www.excelforum.com/showthread...hreadid=386216 |
Output Text in specific place
Cells(rwNum,"C").Value = "Some kind of text"
-- Regards, tom Ogilvy "narutard" wrote in message ... this is pretty easy question but i was wondering how do you output a specific text in a specific place the specific place will be determined by a variable that i previously defined, i.e. the end of a set number of rows. the set number of rows are variable each time, hence i need to use a variable thanks -- narutard ------------------------------------------------------------------------ narutard's Profile: http://www.excelforum.com/member.php...o&userid=25111 View this thread: http://www.excelforum.com/showthread...hreadid=386216 |
Output Text in specific place
Worksheets("MySheet").Cells(rw,col).Text = "Text"
or Worksheets("MySheet").Cells(rw,col).Text = str where Dim rw as Long, col as Long, str as String -- steveB Remove "AYN" from email to respond "narutard" wrote in message ... this is pretty easy question but i was wondering how do you output a specific text in a specific place the specific place will be determined by a variable that i previously defined, i.e. the end of a set number of rows. the set number of rows are variable each time, hence i need to use a variable thanks -- narutard ------------------------------------------------------------------------ narutard's Profile: http://www.excelforum.com/member.php...o&userid=25111 View this thread: http://www.excelforum.com/showthread...hreadid=386216 |
Output Text in specific place
both of those raise errors since the TEXT property of a range is read only.
To the original poster, if you need to write on a sheet that is not the active sheet, then you can qualify your reference with the worksheet name (if you are writing to the activesheet, you can omit the worksheet qualification or use ActiveSheet) Dim rwNum as Long rwNum = 21 worksheets("Sheet1").Cells(rwNum,"C").Value = "Some kind of text" or Dim rwNum as Long, colNum as Long rwNum = 21 colNum = 3 worksheets("Sheet1").Cells(rwNum,colNum).Value = "Some kind of text" The value can be a variable as well. Dim rwNum as Long, colNum as Long Dim sStr as String rwNum = 21 colNum = 3 sStr = "Some kind of text" worksheets("Sheet1").Cells(rwNum,colNum).Value = sStr -- Regards, Tom Ogilvy "STEVE BELL" wrote in message news:w3AAe.39948$ZN6.971@trnddc02... Worksheets("MySheet").Cells(rw,col).Text = "Text" or Worksheets("MySheet").Cells(rw,col).Text = str where Dim rw as Long, col as Long, str as String -- steveB Remove "AYN" from email to respond "narutard" wrote in message ... this is pretty easy question but i was wondering how do you output a specific text in a specific place the specific place will be determined by a variable that i previously defined, i.e. the end of a set number of rows. the set number of rows are variable each time, hence i need to use a variable thanks -- narutard ------------------------------------------------------------------------ narutard's Profile: http://www.excelforum.com/member.php...o&userid=25111 View this thread: http://www.excelforum.com/showthread...hreadid=386216 |
All times are GMT +1. The time now is 03:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com