VBA - Insert Text from Textbox into every nth row

Versonol

New Member
Joined
Jul 10, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hi

I need some help with Vba code to insert the text from the Textbox into every nth row in a specific sheet i.e. Each time the Ok button is pressed, the text from the text box would be inputed into Row1 then Row8 the next time the button is pressed and so on (Sorry for the bad English)

1657476226331.png

1657476293113.png
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi

Would need to modify it to suit your textbox value, but basic idea below.

code goes in your command button and "hi" is your textbox value



VBA Code:
If Range("A1") > "" Then
    Range("a" & Range("A" & Rows.Count).End(xlUp).Row + 7) = "hi"
Else
    Range("a1") = "hi"
End If
 
Upvote 0
Solution

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

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