Copy and Paste Plain Text into new Workbook

NissanGTR

New Member
Joined
Nov 12, 2013
Messages
2
I have a range of cells from A1 to D?? (Anywhere from 10-100) in which contains a bunch of formulas. I need to create a macro which copies and pastes (As plain text and not the formulas) the range of active cells into a new workbook.

The column D may contain Blank Cells. How can i define the range of active cells (from A1 to D?) if there are blanks in the column??
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Please:

Code:
Sub wigi()

    With Cells(1).CurrentRegion.Resize(, 4)
        Workbooks.Add.Sheets(1).Cells(1).Resize(.Rows.Count, .Columns.Count).Value = .Value
    End With

End Sub
 
Upvote 0
Alternatively:

Code:
Sub wigi()

    sq = Cells(1).CurrentRegion.Resize(, 4)
    Workbooks.Add.Sheets(1).Cells(1).Resize(UBound(sq), 4) = sq

End Sub
 
Upvote 0
Alternatively:

Code:
Sub wigi()

    sq = Cells(1).CurrentRegion.Resize(, 4)
    Workbooks.Add.Sheets(1).Cells(1).Resize(UBound(sq), 4) = sq

End Sub

WIGI,

Ive tried both your solutions and got the same result. I apologize as I neglected to mention that the first few rows are empty in the worksheet (As well as the A column) , so i should start at B5 thru I?? (i said A and D earlier but now im trying to avoid the empty cells and add more to the sheet at the same time) rather than A1 and go Down. Could you please help with this?

The copy and paste feature was working but i wasnt getting the returned cells that i need.
 
Upvote 0
If it cell B5 until I ...:

Code:
Sub wigi()

    With Range("B5").CurrentRegion.Resize(, 8)
        Workbooks.Add.Sheets(1).Cells(1).Resize(.Rows.Count, 8).Value = .Value
    End With

End Sub

This code does not like empty rows and empty columns. Please avoid them.

Please can you make the effort to undertstand the code, such that you can change it yourself?
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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