How to fill fill a column with numbers, beginning at number X, counting up.

I simply need to add numbers, beginning with 15,347, (counting
upward), to a column with empty values in a table.

Is there an easy way to do this, rather than completing it in excel
and importing it, then attempting to update the table?

Thanks for any suggestions.
0
Mike
3/16/2008 6:32:38 PM
access 16762 articles. 2 followers. Follow

1 Replies
1674 Views

Similar Articles

[PageSpeed] 25

While I cannot imagine a legitimate use for this, the following code will 
insert rows starting at 15347 and going to 22000

Dim dbCurr As DAO.Database
Dim lngLoop As Long
Dim strSQL As String

  Set dbCurr = CurrentDb

  For lngLoop = 15347 To 22000
    strSQL = "INSERT INTO MyTable (MyField) " & _
      "VALUES (" & lngLoop & ")"
    dbCurr.Execute strSQL, dbFailOnError
  Next lngLoop

  Set dbCurr = Nothing

Prepopulating tables is seldom (if ever) appropriate.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Mike C" <js2k111@yahoo.com> wrote in message 
news:063cb2b7-4a72-4715-8f74-c1f37fa1f6c7@n77g2000hse.googlegroups.com...
>I simply need to add numbers, beginning with 15,347, (counting
> upward), to a column with empty values in a table.
>
> Is there an easy way to do this, rather than completing it in excel
> and importing it, then attempting to update the table?
>
> Thanks for any suggestions. 


0
Douglas
3/16/2008 9:27:54 PM
Reply:

Similar Artilces:

HELP!
Mike - that's exactly what I'm looking for!! Thank you so much! -- nycexcelmonke ----------------------------------------------------------------------- nycexcelmonkey's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1625 View this thread: http://www.excelforum.com/showthread.php?threadid=27658 ...

IF number is grather than 100 color the cell red
I did this before but I can't remember how I did it. I want to have a column of numbers and if they are greater than a certain value ie: 120 , I want the sell to have the color red. Any ideas how to do this in Excel 2007? THanks Take a look at format|conditional formatting. Ron Boetger wrote: > > I did this before but I can't remember how I did it. I want to have a > column of numbers and if they are greater than a certain value ie: 120 > , I want the sell to have the color red. > > Any ideas how to do this in Excel 2007? > > THanks -- Dave Peterson ...

Filling cells in between pairs of numbers
Hello all, I am trying to find an easy way to fill in cells in between pairs of numbers each of which is exactly the average of the pair's difference averaged by the number of these cells greater than the previous. So I have 1 1 2 3 4 8 5 6 7 8 20 9 10 12 13 14 15 45 I want: 1 1 2 3.333333333 3 5.666666667 4 8 5 11 6 14 7 17 8 20 9 23.57142857 10 27.14285714 11 30.71428571 12 34.28571429 13 37.85714286 14 41.42857143 15 45 I know I can do a Fill, Series, but then even with a macro that does a "control shift up fill series enter",...

Sort as "reference column"
Column A has a random sorted list of text values, column D also consists of same values but not in the way sorted as column A. What I want is to sort Column D just like Column A but with the adjacent columns to the right (Column E,F also) should sort together with column D. -- kingjeremy ------------------------------------------------------------------------ kingjeremy's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=26444 View this thread: http://www.excelforum.com/showthread.php?threadid=474882 Hi One way would be to use helper columns. Start by adding a ...

Case filled out from SharePoint
I need to have a simple form my users fill out to submit a case. This would include the Business Required fields on the CRM Case form. Is there an easy way to do this using SharePoint? In other words, the user would go to the SharePoint site, click a link to "Submit a Support Request". This would open a form (Infopath perhaps?) where they fill in a few simple items, click submit, and a new CRM Case is created. This then would fire any pertinent workflows as if the case had been created from within CRM itself. I'm aware there are 3rd party solutions out there but would...

column charts with multiple data sets
My data set is below. I want to show column charts: The first one would be Product A for August made up of data for versions 1-4, column two would be Product A for September made up of data for versions 1-4. The third column would be Product B for August made up of data for versions 1-4, column four would be Product B for September made up of data for versions 1-4. Product Version August September A 1 30,812 365,874 A 2 59,650,018 56,404,138 A 3 29,931,636 28,053,084 A 4 71,972 62,352 B 1 7,094,967 11,718,925 B 2 9,588,255 ...

Matching cells by content then cell fill with color
Thanks to JEM, I am using this routine to color three consecutive cell a specific color, in this case red: Public Sub ThreeCellsRed() ActiveCell.Resize(1,3).Interior.ColorIndex = 3 End Sub What I need now is a way for the routine to continue to find all th similar cells, let's say for sake of disc they are people's names, s when I execute the above on my name, mrh, I want it to continue in th worksheet and find all exact matches and color those same cells red. Another thought, say my name (MRH) is in "A1" and it is also in "D1". But in "D1" I use "...

Print Preview, Office Mac X
...

How can I delete a list from a column?
Hello all -Excel 2003- I have a column L that call a list. When I want to insert a new column in M, this M columns takes also the list of L. I have now the same list in L and M. How can I delete the list from M? Thanks a lot. Select the column and Edit>Clear>Contents. Gord Dibben MS Excel MVP On Mon, 14 Aug 2006 11:20:51 +0200, "Casrlos A." <carlin334@msn.com> wrote: >Hello all -Excel 2003- > >I have a column L that call a list. When I want to insert a new column in >M, this M columns takes also the list of L. >I have now the same list in L a...

grouping cells to sort by only one column
Hi, New to this so please bear with me. I have a spread sheet where I am listing names in column A and othe info relating to that name in columns B and C in the two rows below th name. I then start a different name in the next row down with the info in t two rows below that, and so forth. I want to be able to add more names in the future and be able to sor all of this by column A only. The problem I am having is the info i the other columns moves. I need it to somehow attatch and stay put wit it's corisponding name without moving. In other words how do I make everything from A1 to ...

From field filled in
Hi and thanks in advance for this help. I am using Office 2003 with Exchange 2003. I have a second mailbox setup in my profile. When I reply to an e-mail sent to the other inbox, the From field is automatically filled in with that name. So for example, if the other inbox is "HelpDesk" and I reply to an e-mail in that inbox, the from field is automatically filled in as "HelpDesk". Hope that makes sense. Thanks!! <twytch111@gmail.com> wrote in message news:1175611189.053649.28340@q75g2000hsh.googlegroups.com... > Hi and thanks in advance for this help. I am...

How to Count Columns
Dear all, I need to do a code until the last column with data in one line, but in this code belown, if there is a column with no data, the code doesn't work very well, because it doesn't count this column. count =3D 1 col =3D Application.CountA(Worksheets("resume").Rows(4)) Do Until count =3D col A B C D E F G H I ... 1 2 3 4 5 6 7 With this variant, the code will run until the number 7 because col is equal 7, but I need that the code run until 9. How can I solve this problem? I have different number of columns! Thanks in advan...

Operating fill handle and moving entire cells with keyboard
Is there any way of operating the fill handle or moving entire cells/range of cells with the keyboard rather than using the mouse (drag and drop). Thanks, Tom. Tom Copy or Cut Select range Select top left corner of range. Hold Shift & press End, Arrow down or right. Copy:= Ctrl + C Cut:= Ctl + X Paste Ctl + V To Fill Down or Right Ctrl + D or ctrl + r Use Excel Help and search for keyboard shortcuts for a complete List. Regards Peter >-----Original Message----- >Is there any way of operating the fill handle or moving >entire cells/range of cells with the keyboard rathe...

How do you fix a cell number in excel for mac
Hello, How can i fix a cell in excel for mac. I am a PC user and i allways used the F4 key, but i cant find it for excel for mac. -- Muchas Gracias, Martin From Mac XL Help ("Keyboard Shortcuts" topic): CMD-T Toggle the formula reference style between absolute, relative, and mixed. In article <9FE8FA7E-D0C1-42D4-900E-6B902466F999@microsoft.com>, Martin <Martin@discussions.microsoft.com> wrote: > Hello, > How can i fix a cell in excel for mac. I am a PC user and i allways used the > F4 key, but i cant find it for excel for mac. ...

Have one fill to auto fill aother
My question is simple. I would like to have field 27 = field 25. So when someone enters the data for field 25, the same data auto populated in field 27. Any help is appreciated! Kaylen, In the CotrolSource for Field 27 type... =[field 25] ....assuming of that you are talking about a form in Microsoft Access or did you mean to post this question in the Excel newsgroup? -- Gina Whipp "I feel I have been denied critical, need to know, information!" - Tremors II http://www.regina-whipp.com/index_files/TipList.htm "Kaylen" <Kaylen@discussions....

Display Row Number in Datasheet View
Can someone tell me how I can display the row numbers in a datasheet view when a query is run? I have looked and looked and can not figure out where and how I can do that. I just want it to display like a spreadsheet would with the row and column numbers. On Thu, 11 Feb 2010 12:07:02 -0800, garvic82 <garvic82@discussions.microsoft.com> wrote: >Can someone tell me how I can display the row numbers in a datasheet view >when a query is run? I have looked and looked and can not figure out where >and how I can do that. I just want it to display like a spreadsheet ...

Colours changing in the fill palette and the spreadsheet?
Hi I have a user with Office 2003, and her pc and build is standard as with her colleagues. In Excel the colours would change (cells filled) also if the user goes to her pallette the colours have also changed. Desktop and all other applications colour are fine. The following resolutions have been tried - office detect and repair, updates, asked the user to got to the tools options and reset the pallette and this does not work. She has to log off and back in again in order to set it back to the proper colours. Again this is only affecting Excel? Any pointers? I wish to thank you in advanc...

Filling in blank PO
Hi everybody, I have some question to you, when you create blank PO, then go to content and click Add Item you can see tw boxes. In top one there are all items from your database and in bottom one there are Items you are adding. If you reach number of rows visible in bottom window there is scroll bar comming on right hand side, and as you add more items every new ona is going to the very bottm of the list which is in invisible area. To get there and type in Qty you have to scroll down whole list every time when you add next item. I'm using most recent updates for RMS and I checked i...

How do I auto fill long col. filling blanks with last filled cell
On a large worksheet, is there a way to fill the blanks in a column with the last filled cell without using the autofill handle? My worksheet is over 2000 rows and I am hoping to find some way to mass fill the blanks in Excel. Here is a small example of what I am talking about. Thanks for any tips. S1475 201686 506456 S1888 38254 15623 56731 S9564 46321 156323 M, This ought to work... http://j-walk.com/ss/excel/usertips/tip040.htm Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "MBBeginner" <MBBeginner@discussions.microsoft.com> wrote in m...

fill colors
I cannot view any fill color, no matter if it is in a text box or object. I can see the colors if I perform a print preview. If I email the same object the color does not show either. I have checked to see if the transparency is turned up and it is not. What is wrong? Thanks, Gary Can you send the email to me? Check your printer setup to be sure you have color selected. gsauer at columbus dot rr dot com -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "joy filters" <joy filters@discussions.microsoft.com> wrote in m...

How do I markup a column of numbers without adding a column?
I am trying to markup a column of numbers but do not wish to add a column (eg. Column A * .05 for Column B). Is this possible? You mean you want to add 5% to a range of cells? If so, Enter 1.05 in an empty cell. Copy that cell. Highlight the range you want to change Right-click, choose Paste Special...>Multiply>OK Delete the 1.05 if desired. Regards, Fred "Afreshb" <Afreshb@discussions.microsoft.com> wrote in message news:6E855D4B-0772-4AE0-BA3A-B6356D68A123@microsoft.com... >I am trying to markup a column of numbers but do not wish to add a column ...

Insert random number only if cell empty
Hello. I'd like my spreadsheet to place a 7 digit random number into a cell only the cell is empty, otherwise leave the contents as is. I simply don't want the number to change if one is already present. I currently keep the number static by pressing F9 when I enter the RAND formula, but that forces me to manually change the number when I save the spreadsheet to another name. I'd like the spreadsheet to automatically calculate a new number in the cell as soon as I erase the previous number in that cell. Any help on this issue will be appreciated. Thanks. "M.L.&qu...

Convert row data into column data
I have a row of data that I want to arrange in a column. I have a about 25 cells in 1 row with data. I want 25 cells in 1 column with the data. Is there an easy way to convert the row into a column? I thought I saw how on the newsgroup, but can't find it now. Thanks, Joe Lunker, select the cells, then Edit > Copy. Select a destination cell, then Edit > Paste Special > Transpose > OK. -- DDM "DDM's Microsoft Office Tips and Tricks" Visit us at www.ddmcomputing.com "lunker55" <this_is_not_my_email_address@hotmail.com> wrote in message news:u...

Inverting rows and columns
How do invert rows for columns so i can sort information by columns not rows Edit / Copy then Edit / Paste Special / Tranpose or you can simply sort left to right - look in the options on the sort dialog box. -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL 97/00/02/03 ---------------------------------------------------------------------------- It's easier to beg forgiveness than ask permission :-) ---------------------------------------------------------------------------- "Robkis" <an...

How to create combo box on whole column fastly?
Hi: How can I create combo box on one whole column fastly? Please let me know, thanks. Thanks. -- accessman2 ------------------------------------------------------------------------ accessman2's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=27953 View this thread: http://www.excelforum.com/showthread.php?threadid=474563 Here is a fastly code: Dim ListItems As Variant Dim i As Integer ListItems = Range("A1:A1000").Value ListItems = Application.WorksheetFunction.Transpose(ListItems) With CB1 'CB1 Stands for ComboBox1 For i = 1 To UBound(Li...