PDA

View Full Version : Outputting to more than one cell at the one time in VBA



tomtom412
03-13-2017, 09:17 AM
So i've a worksheet that contains a template that is filled up using a few user forms via vba.

Currently im using

Range("cell").value = Textbox1
to output data thats been inputted into the userform textboxes.

Im also renaming single cells to avoid having to hardcode cell references everytime I make a change to the number of rows/cols etc.

The problem im having is that I have a lot of cells to rename, I cannot just select a large range and rename them, the cells are not all next to one and other.

Is there a way to rename multiple cells for referencing when I want to output data to the sheet, i.e. have 3 cells named " ExampleData " and in my vba code when I execute:


Range("ExampleData").value = textbox1


it outputs the same info inputted into textbox1, but to 3 different cells?


Sorry if this sounds confusing or doesnt make sense. Just want to be able to output to non-contiguous cells at the same time!

Thanks
Tom

mdmackillop
03-13-2017, 10:46 AM
Select your multiple cells and use the Name Manager to name that range. They need not be contiguous.