How would I insert a value to a Cell with the row number of 'I'?

kbj0109

New Member
Joined
Mar 28, 2015
Messages
26
I found a row number with Loop using i,

If I want to insert a value of Total Sales.
How would I write the code to choose the Cell or Range with the raw number i?


This is my current code, but not working.

TotalSales = Qty*Price
Cells("i", "a") = TotalSales.Value

If I put a specific number instead of i there, it works. but with i, It's not.
Anyone can solve the problem?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I just want to know how to use 'I' as a Raw Number when we choose a Cell.

It has to be with ' I '...
 
Upvote 0
see below code

Code:
Sub Test()
For i = 1 To 10
    Cells(i, 2).Value = Cells(i, 1).Value  ' it will copy column A value to column B till row 10
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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