Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 01-22-2018, 01:17 PM
NoSparks NoSparks is offline Data from a specific row in a spread sheet into a form Windows 7 64bit Data from a specific row in a spread sheet into a form Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Well... you've got me baffled. I don't know if your form is a sheet or a real user form or if you're using both.
Without a sample file to give some idea as to what you're working with and talking about, I can only comment on the code you've posted.

The range 'nextrow' is a single cell, assuming you want the data written to that row starting at column 3
try this (you missed copying the sub name)
Code:
'Dim the variables
Dim cNum As Integer
Dim X As Integer
Dim nextrow As Range

'change the number for the number of controls/text boxes on the userform
cNum = 17

Set nextrow = Sheet3.Cells(Rows.Count, 3).End(xlUp).Offset(1, 0)

For X = 1 To cNum
    nextrow.Offset(, X - 1).Value = Me.Controls("Reg" & X).Value
Next X

MsgBox "The data has been sent"

'Clear the controls
For X = 1 To cNum
    Me.Controls("Reg" & X).Value = ""
Next X

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data from a specific row in a spread sheet into a form Simple Spread Sheet TThomas Excel 1 04-07-2016 09:01 PM
extract specific pivot table data to a new sheet theexpat Excel Programming 0 02-18-2016 10:08 AM
Data from a specific row in a spread sheet into a form Using combobox to pass data from an Excel spread sheet to text boxes on userform Stewie840 Word VBA 14 12-17-2015 10:13 PM
changing the spread sheet location on embeded pie chart otuatail PowerPoint 1 03-04-2014 07:20 AM
Condensing a spread sheet hawkeyefxr Excel 4 08-22-2012 05:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft