AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 2,073
- Office Version
- 2019
- 2010
- Platform
- Windows
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...
stackoverflow.com
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