I'm trying to transpose 5 cells vertically into 5 cells horizontally, then do the next 5 verticals under the 5 horizontals. See attached spreadsheet for Column A (original data) and horizontal data (result). VBA code would be most useful, and original data could potentially be 600 cells long.
I have a long header I am pasting to a column "A" on a new Sheet. When the header pastes it is repeating itself but with long blank spaces in between each repeat. The first time goes from A1 to A152, which is all I want. But it shows up again starting at A180225, and again at A212993, and again and again. I only want a single instance of the header in Column A. Here is the macro I am using:
Sub Sort_Cells() Rows("1:1").Select Selection.Copy Sheets.Add after:=Sheets(Sheets.Count) Sheets("Sheet1").Select Columns("A:A").Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ True, Transpose:=True Selection.Columns.AutoFit Range("B1").Select End Sub
I have employee Clock IN - Clock Out as shown in Column A thru C. An employee can have more then 1 Clock In Clock Out as shown for Employee Name Karmen and Haley.
As shown, each employee is separated by "----------------------" and it ends with "REPORT END"
I would like a VB Code to transpose the data as shown in Column G thru H ...
Simple transpose question: Lets say I have a verticle range of data from B3:B13. I wish to have code that will transpose that data into a horizontal range at D3:M3, is that possible?
I think I have a very straight forward problem, I'm copying about 400 values from one workbook to another (from vertical range to horizontal range) and I currently have about 400 lines of code in order to do this. Below I've pasted the code I'm using now but the macro takes an estimated 30 seconds to run. I figure if I can reduce the number of lines the macro will run a lot faster
RowCount = openWb.Sheets("Library Raw Shear Rates").Range("A3").CurrentRegion.Rows.Count With openWb.Sheets("Library Raw Shear Rates").Range("A3")
I have 2 columns on sheet 1 as below. I need a code to put all the data in column B vertically on sheet 2 as the result shows. Please note all cells data will be off various lengths all seperated by a comma.
I am currently using the following code to copy data in a spreadsheet from a horizontal format to a vertical one, i.e before - data1 data2 after -data1 data2
I need to do this all the way down to cells B5000 and N5000 to ensure all data is copied but obviously this makes for a lot of code. Is there any way I can use a For statement to auto increment 4 variables to replace the absolute cell references? I have attached the sheet I am trying to wokr on for reference.
Copy a specific row of column summations (row to be copied varies by # of entries for the month) from each sheet in the workbook into sequential columns on the 1st Sheet. For example, copy Sheet2Row103 columns A thru O and transpose to Sheet1 column “A” rows 1 thru 15, Sheet 2Row56 column A thru O and transpose to Sheet 1 column “B” rows 1 thru 15, etc.). Excel fails to identify the Sheet Number/ Name if you use copy, transpose and paste, it only works if the transpose is performed on the same Sheet!
I need to move data stored in column A to columns B and C, then skip 3 blank lines and perform the operation again. The attachment shows a before and after example. I'm very much a novice.
I have been trying to make a combobox for which the list is a named range. However, this range needs to be transposed. ListFillRange doesn't seem to let me transpose the list first. I've tried transposing the list somewhere else first and then adding it, but it seems to want a range as opposed to a reference to a range. I'm so confused now. This is the basic code that I wish would work.
While I'm at it, could someone explain to be how to refer to a combobox. ie. when you create it, you don't name it so how can you refer to it. That's why I have used the selection tool above to add the list.
I have a workbook with data in it that I want to copy and put in another wookbook. The data looks like this.
D11/22'2005 CX T-7.80 PEl Azabache LDining Out (blank cell) D11/22'2005 CX T-9.50 PAce Hardware LHousehold (blank cell)
What I want is a macro to copy that data until it finds a blank cell and paste/transpose that data in another workbook and then get the next set of data until an other blank cell.
It should look like this when done.
D11/22'2005CXT-7.80PEl AzabacheLDining Out D11/22'2005CXT-9.50PAce HardwareLHousehold
I am trying to write a macro which will autofill specific columns. The macro will set the range from the start of my autofill to the end of my autofill as a constant range.
The problem I need to get around is the end of my range can always change each time I run the macro. For instance, the first time I run the macro I may only need to autofill from row 4 to row 15. The next time, I may only need to autofill from row 4 to 23 (because of user updates). How can I make the end of my range not be a constant address but variable?
I currently have the following code that copies a range opens notepad pastes the range opens save dialog and types the file name. The problem I have is with overwriting the existing file.
Sub ReplaceUnderScores() Selection.Replace What:="_", Replacement:="/", LookAt:=xlPart, _ SearchOrder:=xlByColumns, MatchCase:=False, SearchFormat:=False, _ ReplaceFormat:=False End Sub
I want it to do this for range AL2 through AL2000. Ive tried a few codes trying to get it to work, but cant figure it out.
See attached workbook. If you hit the Export button (runs Export Macro), it creates a new workbook. Most of what I have in the code works fine except the following bit:
This code is coulnm specific, can this code be adapted to look through a range for a match i write this code up to 25 time changing the column it looks at each time, the row always stays the same the location it paste to also always stays the same if it could be made to look through a range in reducing the amount of code to write.
the range it needs to look through would be, row 6 from column B to column Z.
the line i am hoping to adjust for this is below it reads: "WST.Cells(6, 2)Then"
HTML Code: If WS1.Cells(8, 2) = WST.Cells(6, 2) Then WST.Cells(7, 2).Resize(30, 1).Copy Worksheets("torr1").Cells(9, 5).PasteSpecial Paste:=xlPasteValues nextrow = nextrow + 1 End If
I have two workbooks the first named "number" which just contains the number 50000 on sheet 1 cell A1. This "number" workbook is always closed and saved in c:me"number". The second named "sales" has a form control button with code as follows and is always opened and saved in c:me
Sub next invoice() range ("A1"). Value= range ("A1"). value+1 End sub
When I press the button this code does not work because I am missing the vba code to find the close file.
I have a sorted range from the highest to the lowest in range B8:B50000. I need to find the first cell with zero value and last cell with zero value in this range. Then the these rows are selected and deleted.
When I'm using the Macro recorder or even after I've completed a sequence is there a way to change the range so it code always covers the complete range of the data?
how to make such code by VBA. but i'm desperate to have it.
I need a code to copy a two different ranges from two sheets and paste them below the original ranges in each sheet "a range a sheet". And then if a clicked again the same ranges should be pasted after and so on so forth.
When I use this code is only gets A1:N6...: is there anyway to get it to select the range all the way to the end of the data. I tried CurrentRegion and some other stuff but can't get it to work.: The range may go upto line 500 or 3 I just never know.
- go through all the worksheets in the workbook - if the sheets begin with A, C or P - and if monthly index = 0 - sum the range of cells - B33:L51 - output the value into cell L52 - etc
So far this is what I got
For i = 1 To Sheets.Count If Left(Sheets(i).Name, 1) = "A" Or Left(Sheets(i).Name, 1) = "C" Or Left(Sheets(i).Name, 1) = "P" Then
If (MonIndex = 0) Then SUM(B33:L51) ElseIf (Index = 2) Then SUM(B34:L51) ElseIf (Index = 3) Then SUM(B35:L51) End If
My questions really are - how do u write the code for it to generically know to sum the range B33-L51 for like all sheets required. - and is it possible to output that value to a specific cell in each sheet?
I am writing some code to help speed up data input into Excel. I take the info from the user through a form. Before pasting the data into a spreadsheet, I need to check that there is no data there already.
How can I check that the sum of range of cells in excel, as specified by the user in the form, is Zero?
I want to do this in the code rather than enter another cell in excel and sum it there
I have this VBA (from a recorded macro) how can I amend it so that these two formulas change depending on the number of values....right now the range is to 129 only because we only have 129 cells of info but some sheets will have more some will have less. I want excel to base it based on the column I which used to be H.
VB: Sub SLCREPORTDATA() Cells.Select Range("F1").Activate Cells.EntireColumn.AutoFit Columns("H:H").Select