insert cellls vba

rakesh seebaruth

Active Member
Joined
Oct 6, 2011
Messages
303
Hi Guys

I have the following code

Cells(LR, 28).Value = txtCNum4.Value

In my useform txtCNum4 is a text box name Lease Period

What i want is when the user enters a number let's say 10.

vba inserts 10 cells after Cells(LR, 28) and i also want vba to add a heading month1 to month10 to those cells

thanks/regards

rakesh
 
Last edited:

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
thanks Paul it works.

Right now i am going to work. I have other issues. I will try to solve it.If it does not work i will revert to u.

Thanks again for your precious help

regards

rakesh
 
Upvote 0
Hi Paul

I need your help


If Lease Period is equal to 5(for example) then add 5 columns and name it month 1 to month 5. It works fine.

Now if Installment is equal to 10,000 then it should populate cells Cells(2, 33) as per below

Month1 Month2 Month3 Month4 Month5

10,000 10,000 10,000 10,000 10,000

Thanks/regards


rakesh
 
Upvote 0
I'm just about to go out, but the code is all there. Use the loop

Code:
    For i = 0 To txtCNum4.Value -1
        Cells(LR, [COLOR=#0000cd][I]1st column of [/I][/COLOR][COLOR=#0000cd][I]instalments[/I][/COLOR] + i) = textbox [I][COLOR=#0000cd]whatever the instalment is[/COLOR][/I]
    Next
 
Upvote 0

Forum statistics

Threads
1,223,898
Messages
6,175,272
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top