![]() |
Paste Cells in Column A to Columns B-K
Hi All,
I was wondering if someone can help with writing an Excel Macro or some scripting. What I am trying to achieve is the following. In Column A (A1:A1000) there are values of L0xxxxxx xxxxxx=numbers (i.e L0123456) What I want to be able to do is move the values from column A to Columns B-K (10 Columns) 10 values at a time, upto 100 lines. A B C D E F G H I J K L00001 L00001 L00002 L00003 L00004 .5 .6 .7 .8 .9 L00010 L00002 L00011 L00003 L00004 ..5 ..6 ..7 ..8 ..9 L00010 L00011 Any help would be appreciated. Thanks George |
Paste Cells in Column A to Columns B-K
I do not follow your example.
What determines the values in cols B to K? In your example it is not obvious what dictates the values. What you write implies that the cols B to K should have the SAME value as col A but your example does not support this. When you say "10 at a time" do you mean from A1:A10 into all the appropriate cols or do you meant A1 to B1:K1? Chrissy. George Plakas wrote Hi All, I was wondering if someone can help with writing an Excel Macro or some scripting. What I am trying to achieve is the following. In Column A (A1:A1000) there are values of L0xxxxxx xxxxxx=numbers (i.e L0123456) What I want to be able to do is move the values from column A to Columns B-K (10 Columns) 10 values at a time, upto 100 lines. A B C D E F G H I J K L00001 L00001 L00002 L00003 L00004 .5 .6 .7 .8 .9 L00010 L00002 L00011 L00003 L00004 .5 .6 .7 .8 .9 L00010 L00011 Any help would be appreciated. Thanks George |
Paste Cells in Column A to Columns B-K
Sorry Chrissy,
What I mean is to move from:- Cells A1 to B1 Cells A2 to C1 Cells A3 to D1 Cells A4 to E1 Cells A5 to F1 Cells A6 to G1 Cells A7 to H1 Cells A8 to I1 Cells A9 to J1 Cells A10 to K1 Cells A11 to B2 Cells A12 to C2 Cells A13 to D2 Cells A14 to E2 Cells A15 to F2 Cells A16 to G2 Cells A17 to H2 Cells A18 to I2 Cells A19 to J2 Cells A20 to K2 Cells A21 to B3 Cells A22 to C3 ans so on. Hope this helps. Thanks George *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Paste Cells in Column A to Columns B-K
Sub MoveData()
Dim RNG As Range Dim iCol As Integer Dim iCols As Integer Dim iRows As Integer Dim iCount As Integer iCol = 0 iCols = 10 ' Number of Cols you want to use iRows = 1000 ' Number of Rows of Data Set RNG = Range("A1") ' The Top Left of the Data For iCount = 0 To iRows / iCols For iCol = 1 To iCols RNG.Offset(iCount, iCol) = RNG.Offset(iCount * iCols + iCol - 1, 0) Next iCol Next iCount End Sub Chrissy. "George Plakas" wrote in message ... Sorry Chrissy, What I mean is to move from:- Cells A1 to B1 Cells A2 to C1 Cells A3 to D1 Cells A4 to E1 Cells A5 to F1 Cells A6 to G1 Cells A7 to H1 Cells A8 to I1 Cells A9 to J1 Cells A10 to K1 Cells A11 to B2 Cells A12 to C2 Cells A13 to D2 Cells A14 to E2 Cells A15 to F2 Cells A16 to G2 Cells A17 to H2 Cells A18 to I2 Cells A19 to J2 Cells A20 to K2 Cells A21 to B3 Cells A22 to C3 ans so on. Hope this helps. Thanks George *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Paste Cells in Column A to Columns B-K
Hi,
You don't need a macro for this... Do the following 1. Select all the cells you want to change(Copy) 2. create a new sheet 3. go to the paste special screen 4. check the "Transpose" 5. Click OK If you don't see what you expected. Please le me know Annamala |
Paste Cells in Column A to Columns B-K
"Chrissy" wrote in message ...
Sub MoveData() Dim RNG As Range Dim iCol As Integer Dim iCols As Integer Dim iRows As Integer Dim iCount As Integer iCol = 0 iCols = 10 ' Number of Cols you want to use iRows = 1000 ' Number of Rows of Data Set RNG = Range("A1") ' The Top Left of the Data For iCount = 0 To iRows / iCols For iCol = 1 To iCols RNG.Offset(iCount, iCol) = RNG.Offset(iCount * iCols + iCol - 1, 0) Next iCol Next iCount End Sub Chrissy. "George Plakas" wrote in message ... Sorry Chrissy, What I mean is to move from:- Cells A1 to B1 Cells A2 to C1 Cells A3 to D1 Cells A4 to E1 Cells A5 to F1 Cells A6 to G1 Cells A7 to H1 Cells A8 to I1 Cells A9 to J1 Cells A10 to K1 Cells A11 to B2 Cells A12 to C2 Cells A13 to D2 Cells A14 to E2 Cells A15 to F2 Cells A16 to G2 Cells A17 to H2 Cells A18 to I2 Cells A19 to J2 Cells A20 to K2 Cells A21 to B3 Cells A22 to C3 ans so on. Hope this helps. Thanks George *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Hi, You don't need a macro for this... Do the following 1. Select all the cells you want to change(Copy) 2. create a new sheet 3. go to the paste special screen 4. check the "Transpose" 5. Click OK If you don't see what you expected. Please le me know Annamala |
Paste Cells in Column A to Columns B-K
What you suggest will take the 1000 cells, from cells A1:A1000
and put them into one line. That will not work as there are only 256 columns. Even if it did work, it would not give the OP what he wanted which is a 10x100 grid of numbers from his original list of 1000 cells. You are correct that you do not need a macro. The way you suggest is not the solution thought. To do it without a macro you would enter this formula into each of the cells in the 10x100 grid where the results are needed. This requires the original data to be in cells A1:An and the results to be in cells B1:K(n/10) but it can be modified for any number of columns and any destination area =INDIRECT("A"&(ROW()-1)*10+COLUMN()-1) Chrissy. Annamala wrote Hi, You don't need a macro for this... Do the following 1. Select all the cells you want to change(Copy) 2. create a new sheet 3. go to the paste special screen 4. check the "Transpose" 5. Click OK If you don't see what you expected. Please le me know Annamala |
Paste Cells in Column A to Columns B-K
Hi Chrissy, That worked fine, Thank You for you help. Just quickly, is there a way to delete the contents in Column A as the values moves accross to columns B-K. I know that if I run the following macro it will replace whatever is in Column A for me with the value I enter through the dialog box. What I was wondering is, that I will not always have 100 rows, so is there a way you can determine how many rows have been populated once all values move from Column A, so when I enter the box no, it only populates the rows (In Column A) that have the L0*.* value in columns B-K. Any help would be appreciated and once again Thank You. Sub BoxNo() Dim userInput As Variant x = InputBox("Enter a Box No") ' Enter, e.g., 1205 Range("A1:A100").Formula = "=" & x & "" End Sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Paste Cells in Column A to Columns B-K
There is ALWAYS a way to do what ever you can dream up
EXCPET maybe (and I say maybe) washing the dishes and the windows with Excel macros. In fact, there are many ways to do the same thing. The question is not CAN it be done but HOW SHOULD it be done and WHAT EXACTLY you want done. I suspect that you have decided that the way you have to do this is to have a macro which does all the work and then you have to have another macro to delete the original data etc. Maybe if you explain what data you have and what you want then we can come up with a technically more appropriate than others. As far as what I can work out you are asking in this post, you could just add code to delete the column or to clear the contents. Another option would be to put the results in cols A to J and then clear the contents of the remaining cells in col A at the end of the block - that is cells A101:A1000 in your original example. What you are trying to do with your BoxNo macro I do not know. You define userImput and never use it. You use x and do not define it. You enter the data "=" & x into the range A1:A100 this will put =1205 (if the user enters 1205 into the input box) into that range. This macro would do EXACTLY the same thing Sub BoxNo() Range("A1:A100").Formula = "=" & InputBox("Enter a Box No") End Sub There does not seem to be a point in using a formula there either. This would look the same to the user. Sub BoxNo() Range("A1:A100") = InputBox("Enter a Box No") End Sub and the cells would contain 1205 (if the user enters 1205 into the input box) So, what are you trying to do. Chrissy. "George Plakas" wrote in message ... Hi Chrissy, That worked fine, Thank You for you help. Just quickly, is there a way to delete the contents in Column A as the values moves accross to columns B-K. I know that if I run the following macro it will replace whatever is in Column A for me with the value I enter through the dialog box. What I was wondering is, that I will not always have 100 rows, so is there a way you can determine how many rows have been populated once all values move from Column A, so when I enter the box no, it only populates the rows (In Column A) that have the L0*.* value in columns B-K. Any help would be appreciated and once again Thank You. Sub BoxNo() Dim userInput As Variant x = InputBox("Enter a Box No") ' Enter, e.g., 1205 Range("A1:A100").Formula = "=" & x & "" End Sub *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Paste Cells in Column A to Columns B-K
Hi Chrissy,
Can I send you the spreadsheet I have and the log file that gets used to an email address and I will also give you a detailed explanation of what I am trying to achieve. It would probably make things much easier to understand. Thanks George *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Paste Cells in Column A to Columns B-K
Yes you can. The e-mail addy I post from just needs the xxx. removed
and is valid. Chrissy. George Plakas wrote Hi Chrissy, Can I send you the spreadsheet I have and the log file that gets used to an email address and I will also give you a detailed explanation of what I am trying to achieve. It would probably make things much easier to understand. |
All times are GMT +1. The time now is 09:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com