开发者

Macro to split weight into columns Request

开发者 https://www.devze.com 2023-03-12 00:32 出处:网络
Let\'s say I have a column of numbers in A2 going down, to a random number, such as: 0.50 1.00 1.00 1.10 1.10

Let's say I have a column of numbers in A2 going down, to a random number, such as:

0.50
1.00
1.00
1.10
1.10

And I wanted a macro to split them into Major and Minor basically.. Anything before the Period, I want moved over to Column B. Anything after the Period I would like moved to Column C, and the . Just removed completely.

So

   B  C
   0  50
   1  00
   1  00
   1  10
   1  10

Like that开发者_JAVA技巧, Pretty simple. I don't know enough about Excel VBA to write it.


Just record the following macro:

  1. Copy column A to B
  2. Format column B as text
  3. Data->TextToColumn on Column B with separator "."


I would just use formulas instead of VBA. Put this in B2:

=INT(A2)

and this in C2:

=(A2-B2)*100

Then copy and paste down.

0

精彩评论

暂无评论...
验证码 换一张
取 消