Okay! I've made my introduction and now here is my very first post. Excited? Yeah, thought so. Me too...
I'm working with a large volume of data and maybe I just need to go about it a different way but in addition to passing the array itself to the range, I'd like to prefix each cell with a single quote.
I'm using the basic Array to range logic but I can't seem to visualize putting the quote in without a loop. Any ideas?
Sub ArrayToRange(aData As Variant, sStartingAddress As String)
' First get Array of data from Essbase
' This code won't work for most but it's just a string variant that is returned, i.e.
' aData(0)=345
' aData(1)=456
' and so on... you get the idea.
' Now update the range
Dim rngData As range
' Set range
Set rngData = range(sStartingAddress & ":" & _
range(sStartingAddress).Offset(0, sValues).Address)
' Works but doesn't have my prefix
rngData.Value2 = aData
' This doesn't and shouldn't work but I'd like to find what will....?
rngData.Value2 = "<myPrefix_goes_here>" & aData
Set rngData = Nothing
End Sub
Thanks in advance.
Bookmarks