473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Excel Question

1,892 Expert 1GB
Does anyone know how to select all of the fields in the column that are populated? I want to select all of column B and paste new info in, however I don't want to populate the fields by selecting all of column B. I would highlight all of them then copy but it's 11000 rows and it takes forever to do.

Thanks,
AC
Nov 1 '06 #1
5 1846
albertw
267 100+
Does anyone know how to select all of the fields in the column that are populated? I want to select all of column B and paste new info in, however I don't want to populate the fields by selecting all of column B. I would highlight all of them then copy but it's 11000 rows and it takes forever to do.

Thanks,
AC
hi

try a button and this small macro
assuming NewInfo for all cell in Column B is same ?

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub CommandButton1_Click()
  3. NewInfo = InputBox("Enter new info", "Info")
  4. If Not NewInfo = vbNullString Then
  5. Counter = 0
  6. Do
  7. Range("B1").Offset(Counter, 0).Value = NewInfo
  8. Counter = Counter + 1
  9. Loop Until Counter = 11000
  10. End If
  11. End Sub
  12.  
  13.  
Nov 1 '06 #2
AricC
1,892 Expert 1GB
A button in excel? How do you add a button in excel?
Nov 3 '06 #3
albertw
267 100+
A button in excel? How do you add a button in excel?
hi
simply click with your right mousebutton on the menubar
select visual basic
from the shown window select toolbox and edit mode
select button from the toolbox
when in editmode you may doubleclick this button to gain access to the codepage, or use Alt+F11
Nov 3 '06 #4
AricC
1,892 Expert 1GB
What about one that doesn't require hard coded value like 11000? Is that possible?
Nov 3 '06 #5
albertw
267 100+
What about one that doesn't require hard coded value like 11000? Is that possible?
hi
yes possible, search in same column for first item to be empty

Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton1_Click()
  2. NewInfo = InputBox("Enter new info", "Info")
  3. If Not NewInfo = vbNullString Then
  4. Counter = 0
  5. Do
  6. Range("B1").Offset(Counter, 0).Value = NewInfo
  7. Counter = Counter + 1
  8. Loop Until Range("B1").Offset(Counter, 0).Value = vbNullString
  9. End If
  10. End Sub
  11.  
Nov 3 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Sam Johnson | last post by:
HI I tried to send the following SQL string to an open databse, to export a table into excel format: g.Connection = conn 'valid OleDBConnection and Command objects g.CommandText = "SELECT *...
19
by: wreckingcru | last post by:
I'm trying to output a SQL query that is constructed thru my VB.net GUI into an excel file. Here is the code I'm using: 'Sqlstmt is the SQL query statement 'Conn is the SQL Connection object...
9
by: Doug Glancy | last post by:
I got the following code from Francesco Balena's site, for disposing of Com objects: Sub SetNothing(Of T)(ByRef obj As T) ' Dispose of the object if possible If obj IsNot Nothing AndAlso...
3
by: pleaseexplaintome_2 | last post by:
using the code below (some parts not included), I create a new excel workbook with spreadheets. I then want to delete a spreadsheet, but a reference remains open and excel stays in task manager...
3
by: akristensen | last post by:
I am new to this site, so be patient if I do not ask the question correctly. Current Target Platform: Browser: MS IE, script language: Javascript (will use VBScript, but JS is preferred), External...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.