dixiecricket
New Member
- Joined
- Jun 15, 2015
- Messages
- 9
I have looked (unsuccessfully) for relevant posts but my problem is as follows. I have a workbook with multiple worksheets.
On my first sheet, I have four cells that have associated data validation listboxes/userforms that if the user selects the items results in a comma-delimited value for that field. Via code, I then break out each CSV using TEXTTOCOLUMNS so that each value is in its own column.
On my second sheet, I loop through the potential cell range from the first sheet and if the ISEMPTY(cell range from first sheet) = false, then I was to copy those values into the first empty cell beginning at "BB3" and remaining on row 3 - offsetting to the right as needed. So far I am unable to pull in all of my values from the first sheet into the second.
I am weak in VBA so excuse any simpleton mistakes below:
Dim cell As Range
For Each cell In Sheets("PM Tab").Range("G15:G18")
If IsEmpty(cell) = False Then
cell.TextToColumns Destination:=cell.Offset(0, 2), DataType:=xlDelimited, Comma:=True
End If
Next cell
Dim extras As Range
For Each extras In Sheets("PM Tab").Range("I15:AA18")
If IsEmpty(extras) = False Then
extras.Copy
If IsEmpty(Worksheets("Data").Range("BB3")) = True Then
Worksheets("Data").Range("BB3").PasteSpecial Paste:=xlPasteValues
Else
Worksheets("Data").Range("BB3").Offset(0, 1).PasteSpecial Paste:=xlPasteValues
End If
End If
Next extras
Thank you!
On my first sheet, I have four cells that have associated data validation listboxes/userforms that if the user selects the items results in a comma-delimited value for that field. Via code, I then break out each CSV using TEXTTOCOLUMNS so that each value is in its own column.
On my second sheet, I loop through the potential cell range from the first sheet and if the ISEMPTY(cell range from first sheet) = false, then I was to copy those values into the first empty cell beginning at "BB3" and remaining on row 3 - offsetting to the right as needed. So far I am unable to pull in all of my values from the first sheet into the second.
I am weak in VBA so excuse any simpleton mistakes below:
Dim cell As Range
For Each cell In Sheets("PM Tab").Range("G15:G18")
If IsEmpty(cell) = False Then
cell.TextToColumns Destination:=cell.Offset(0, 2), DataType:=xlDelimited, Comma:=True
End If
Next cell
Dim extras As Range
For Each extras In Sheets("PM Tab").Range("I15:AA18")
If IsEmpty(extras) = False Then
extras.Copy
If IsEmpty(Worksheets("Data").Range("BB3")) = True Then
Worksheets("Data").Range("BB3").PasteSpecial Paste:=xlPasteValues
Else
Worksheets("Data").Range("BB3").Offset(0, 1).PasteSpecial Paste:=xlPasteValues
End If
End If
Next extras
Thank you!