VBA code needed to paste from range one sheet to empty column on another sheet

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!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Anyone feel like taking a stab? It's entirely possible I have overcomplicated getting the information from the first sheet to the second....
 
Upvote 0

Forum statistics

Threads
1,214,565
Messages
6,120,254
Members
448,952
Latest member
kjurney

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top