Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A variable in VB
Hi,
I am new VB coding and want to do the following: Range("B12").Value = myVariable But ... where the cloumn heading is a variable also I have been able to write it as: cellRef = columnVar + "12" Range("cellRef").Value = myVariable Is it possible to parse the line 'Range("B12").Value = myVariable' so that B is a variable also?? Thanks for any ideas help --- Message posted from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
A variable in VB
Try something like
Dim R As Long Dim C As String R = 12 C = "B" Cells(R,C).Value = myVariable -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "ecando " wrote in message ... Hi, I am new VB coding and want to do the following: Range("B12").Value = myVariable But ... where the cloumn heading is a variable also I have been able to write it as: cellRef = columnVar + "12" Range("cellRef").Value = myVariable Is it possible to parse the line 'Range("B12").Value = myVariable' so that B is a variable also?? Thanks for any ideas help --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
A variable in VB
Try this
columnVar = "B" cellRef = columnVar & 12 'Range(cellRef).Value = myVariable Range(cellRef).Select -- Regards Ron de Bruin http://www.rondebruin.nl "ecando " wrote in message ... Hi, I am new VB coding and want to do the following: Range("B12").Value = myVariable But ... where the cloumn heading is a variable also I have been able to write it as: cellRef = columnVar + "12" Range("cellRef").Value = myVariable Is it possible to parse the line 'Range("B12").Value = myVariable' so that B is a variable also?? Thanks for any ideas help --- Message posted from http://www.ExcelForum.com/ |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
A variable in VB
Chip Pearson wrote:
[b]Try something like Dim R As Long Dim C As String R = 12 C = "B" Cells(R,C).Value = myVariable -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com EXACTLY what I need ... Thanks Chip :) --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
variable height variable width stacked bar charts | Charts and Charting in Excel | |||
Sum cells based on a row variable and seperate column variable | Excel Worksheet Functions | |||
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? | Excel Worksheet Functions | |||
setting a range variable equal to the value of a string variable | Excel Programming | |||
Cells.Find error Object variable or With block variable not set | Excel Programming |