AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 1,940
- Office Version
- 2019
- 2016
- Platform
- Windows
![stackoverflow.com](/board/proxy.php?image=https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded&hash=d2814594116fe3281317608db19c4357&return_error=1)
How can I print a range variable in the immediate window? Excel VBA
I'm attempting something that should be very simple. However I've just started learning today and and can't quite understand. This is my code so far: Public Sub getCellData() Dim wb As Workboo...
Using a suggestion above I'm trying to put the values in a range into a csv string.
But I get error 5 invalid call on the transpose line.
VBA Code:
Function CROK(excelRow)
Dim cc As Integer
Dim cr As Range
Dim strData As String
Dim wsf As WorksheetFunction: Set wsf = Application.WorksheetFunction
cc = 95
With Worksheets("Sheet1")
Do
cc = cc - 1
Loop Until .Cells(excelRow, cc) > " 'get first populated cell moving from column CP back
Set cr = .Range("Y" & excelRow & ":" & colLetter(cc) & excelRow)
strData = Join(wsf.Transpose(cr.Value), ",")
Stop
End With
End function