default_name
Board Regular
- Joined
- May 16, 2018
- Messages
- 180
- Office Version
- 365
- 2016
- Platform
- Windows
- MacOS
Hey guys,
I have three different worksheets.
RawDataA
RawDataB
ReducedData
Basically, I only want to take certain columns of data from each of the RawData sheets and comiple them together in the ReducedRawData worksheet.
With what I currently have, I am running into issues copying over the column down to the end of the row. (I only want to copy over column data down to the end of the raw data [the last row])
Here is what I currently have:
I added comments to hopefully illustrate what I am trying to do
I seem to be having a few issues here.
The EndRow function isnt working as I'd hoped.
I am using two different methods of copying (Columns and Range)...is there another way to accomplish this for consistency?
Really, I'd like all of the copies/pastes to be Values only for formatting sake...but I'm not sure of the proper way to accomplish that.
I hope this makes sense. Thanks in advance for your help and patience!
I have three different worksheets.
RawDataA
RawDataB
ReducedData
Basically, I only want to take certain columns of data from each of the RawData sheets and comiple them together in the ReducedRawData worksheet.
With what I currently have, I am running into issues copying over the column down to the end of the row. (I only want to copy over column data down to the end of the raw data [the last row])
Here is what I currently have:
I added comments to hopefully illustrate what I am trying to do
VBA Code:
Sub DataReduce()
EndRow = Sheets("ReducedData").Cells(Rows.Count, 1).End(xlUp).Row + 1
'Brings over RawDataA information from the various columns and pastes it into columns A, B, and C of the ReducedData sheet
Sheets("RawDataA").Columns("B").Copy Sheets("ReducedData").Range("A1") 'Copies raw data from column B of RawDataA over to column A (starting in A1) of the ReducedData sheet
Sheets("RawDataA").Columns("J").Copy Sheets("ReducedData").Range("B1") 'Copies raw data from column J of RawDataA over to column B (starting in B1) of the ReducedData sheet
Sheets("RawDataA").Range("E1" & ":" & "E" & EndRow).Copy 'Copies raw data from column E of RawDataA. I used Range instead of Columns because I couldnt figure out the Special paste with Columns.
Sheets("ReducedData").Range("C1").PasteSpecial Paste:=xlPasteValues 'Pastes over the Values into column C (starting in C1) of the ReducedData sheet
'Brings over RawDataB information from the various columns and pastes it to the bottom of columns A, B, and C of the ReducedData sheet
Sheets("RawDataB").Range("U2" & ":" & "U" & EndRow).Copy Sheets("ReducedData").Range("A" & EndRow) 'Copies raw data from column U of RawDataB (all the way to the bottom) over to column A (starting after the data we just pasted above from RawDataA) of the ReducedData sheet
Sheets("RawDataB").Range("W2" & ":" & "W" & EndRow).Copy Sheets("ReducedData").Range("B" & EndRow) 'Copies raw data from column W of RawDataB (all the way to the bottom) over to column B (starting after the data we just pasted above from RawDataA) of the ReducedData sheet
Sheets("RawDataB").Range("F2" & ":" & "F" & EndRow).Copy 'Copies raw data from column F of RawDataB (all the way to the bottom).
Sheets("ReducedData").Range("C" & EndRow).PasteSpecial Paste:=xlPasteValues 'Pastes over the Values into column C (starting after the data we just pasted above from RawDataA) of the ReducedData sheet
End Sub
I seem to be having a few issues here.
The EndRow function isnt working as I'd hoped.
I am using two different methods of copying (Columns and Range)...is there another way to accomplish this for consistency?
Really, I'd like all of the copies/pastes to be Values only for formatting sake...but I'm not sure of the proper way to accomplish that.
I hope this makes sense. Thanks in advance for your help and patience!