Solved Macro for editing data

August 12, 2011 at 09:02:16
Specs: Windows XP
I want to copy cells A1-A10 and transpose and paste them in cell B1. And then perform this again for data in A11-A20 and transpose +paste in B2. I want to do this for a set of A1-A100. All this using macro.

See More: Macro for editing data

Report •


✔ Best Answer
August 15, 2011 at 05:03:25


#1
August 12, 2011 at 09:58:45
So something like this?
Sub a()
  Dim r As Range
  For Each r In ActiveSheet.Range("A1:A100")
    rRow = r.Row - 1
    ActiveSheet.Cells(Int(rRow / 10) + 1, (rRow Mod 10) + 2) = r
  Next
End Sub

How To Ask Questions The Smart Way


Report •

#2
August 12, 2011 at 10:36:58
hi Razor,

for some reason it doesn't seem to work. Is it possible for me to speak to you directly via email? my email address is (Deleted by Moderator)

edited by moderator: email address deleted


Report •

#3
August 12, 2011 at 11:09:41
Please do not post your email address in this forum or any other public forum.

It's not that we really care if you get hit with a lot of spam, it's that we do not want to be known as a site where email addresses can be harvested.

Once the bad guys start hanging around, we will be open to all sorts of security problems.

If you want to send someone your email address, use the Private Message feature of this forum.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
August 12, 2011 at 11:25:04
Is it possible for me to speak to you directly via email?
Probably not. The sub works fine for me, the problem's just not that interesting, and "it doesn't work" is too vague to pique my interest. Sorry.

How To Ask Questions The Smart Way


Report •

#5
August 12, 2011 at 15:19:06
Or, to put it more mildly...

All issues should be posted in this forum for all members to share and/or help out with. It will also ensure that the thread gets stored in the archives so that others can benefit from the solution in the future.

BTW...Razor2.3's code works perfectly fine for me also. It does exactly what you asked for in your original post.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#6
August 15, 2011 at 01:33:59
No problem. I tried again today, it worked. My bad. Could you also tell me how to delete the first column from which data was transposed simultaneously while using the macro that you described?

Thanks.


Report •

#7
August 15, 2011 at 05:03:25
✔ Best Answer
Columns("A").EntireColumn.Delete

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#8
August 15, 2011 at 06:23:57
1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1		7433
0.06	0.07	0.06	0.06	0.05	0.05	0.06	0.05	0.05	0.07	0.06	0.07	0.08	0.08	0.08	0.07		428
0.029	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.03		171
0.43	0.49	0.46	0.49	0.4	0.35	0.43	0.35	0.37	0.44	0.36	0.42	0.47	0.47	0.4	0.48		1597
0.0817	0.0931	0.0874	0.0931	0.076	0.0665	0.0817	0.0665	0.0703	0.0836	0.0684	0.0798	0.0893	0.0893	0.076	0.0912		8
0.078	0.089	0.083	0.089	0.073	0.063	0.078	0.064	0.067	0.08	0.065	0.076	0.085	0.085	0.073	0.087		1589
0.1	0.14	0.12	0.13	0.13	0.11	0.11	0.11	0.06	0.12	0.11	0.11	0.09	0.05	0.05	0.05		717
0.089	0.1246	0.1068	0.1157	0.1157	0.0979	0.0979	0.0979	0.0534	0.1068	0.0979	0.0979	0.0801	0.0445	0.0445	0.0445		641
0.0105	0.0147	0.0126	0.01365	0.01365	0.01155	0.01155	0.01155	0.0063	0.0126	0.01155	0.01155	0.00945	0.00525	0.00525	0.00525		76
0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001	0.001		8
0.29	0.21	0.24	0.25	0.24	0.27	0.19	0.09	0.24	0.23	0.25	0.24	0.3	0.27	0.35	0.33		2219
0.16	0.11	0.12	0.1	0.21	0.24	0.22	0.4	0.3	0.17	0.24	0.2	0	0.01	0.02	0.01		336
0	0	0	0	0	0	0	0	0	0	0	0	0.09	0.13	0.1	0.05		469
0	0	0	0	0	0	0	0	0	0	0	0	0.0675	0.0975	0.075	0.0375		350
0	0	0	0	0	0	0	0	0	0	0	0	0.0225	0.0325	0.025	0.0125		119
0.02	0.03	0.03	0.03	0.03	0.03	0.03	0.03	0.02	0.02	0.03	0.02	0.04	0.04	0.04	0.04		108


Report •

#9
August 15, 2011 at 06:26:20
hi, can you help me solve the above 16 variable equation with the right most column with constants and all other values are coefficients of 16 variables and 16 equations. Please let me know if it's not clear.

Thanks a lot. I tried using one code, but it gace me an error. I don't understand why I am getting an error.

Thanks,

Abhishek


Report •


Ask Question