Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Remove data from column

Hi all. I have the following bit of code that presents an input box
for a user to add data to the next available cell in column A. I
would like to now present the user with a pop-up menu picklist that
will display all entries in column A, allow them to pick on, and upon
clicking OK remove that selected item from column A.

Any ideas? Thanks!

Sub NewCategory()

Dim ans As String

ans = InputBox("Enter New Category", "New Category")

Sheets("Cat Picklist").Cells(2, "a").End(xlDown).Offset(1) = ans

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Remove data from column

If you only want to delete 1, just do it. I assume??? you want to
delete more. ??Explain. Perhaps using datafilterautofilter is the
simple answer.

On Feb 9, 3:56*pm, Steve wrote:
Hi all. *I have the following bit of code that presents an input box
for a user to add data to the next available cell in column A. *I
would like to now present the user with a pop-up menu picklist that
will display all entries in column A, allow them to pick on, and upon
clicking OK remove that selected item from column A.

Any ideas? *Thanks!

Sub NewCategory()

Dim ans As String

* * ans = InputBox("Enter New Category", "New Category")

* * Sheets("Cat Picklist").Cells(2, "a").End(xlDown).Offset(1) = ans

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Remove data from column

Hi Don. The column of data, and field that I want to delete is in a
hidden sheet. The column of data feeds a dynamic named range, which
is used in a data validation picklist on a different sheet. So yes, I
would usually only delete one field...just in a nice user interface
vs. toggling over to another sheet, which we have hidden. This file
will be used in a conference room setting, projected on the wall...so
we're trying to make changes quickly and seem somewhat
sophisticated :)

On Feb 9, 4:34*pm, Don Guillett wrote:
If you only want to delete 1, just do it. I assume??? you want to
delete more. ??Explain. Perhaps using datafilterautofilter is the
simple answer.

On Feb 9, 3:56*pm, Steve wrote:



Hi all. *I have the following bit of code that presents an input box
for a user to add data to the next available cell in column A. *I
would like to now present the user with a pop-up menu picklist that
will display all entries in column A, allow them to pick on, and upon
clicking OK remove that selected item from column A.


Any ideas? *Thanks!


Sub NewCategory()


Dim ans As String


* * ans = InputBox("Enter New Category", "New Category")


* * Sheets("Cat Picklist").Cells(2, "a").End(xlDown).Offset(1) = ans


End Sub- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Remove data from column

On Feb 9, 6:03*pm, Steve wrote:
Hi Don. *The column of data, and field that I want to delete is in a
hidden sheet. *The column of data feeds a dynamic named range, which
is used in a data validation picklist on a different sheet. *So yes, I
would usually only delete one field...just in a nice user interface
vs. toggling over to another sheet, which we have hidden. *This file
will be used in a conference room setting, projected on the wall...so
we're trying to make changes quickly and seem somewhat
sophisticated :)

On Feb 9, 4:34*pm, Don Guillett wrote:







If you only want to delete 1, just do it. I assume??? you want to
delete more. ??Explain. Perhaps using datafilterautofilter is the
simple answer.


On Feb 9, 3:56*pm, Steve wrote:


Hi all. *I have the following bit of code that presents an input box
for a user to add data to the next available cell in column A. *I
would like to now present the user with a pop-up menu picklist that
will display all entries in column A, allow them to pick on, and upon
clicking OK remove that selected item from column A.


Any ideas? *Thanks!


Sub NewCategory()


Dim ans As String


* * ans = InputBox("Enter New Category", "New Category")


* * Sheets("Cat Picklist").Cells(2, "a").End(xlDown).Offset(1) = ans


End Sub- Hide quoted text -


- Show quoted text -


If desired, send your file to dguillett1 @gmail.com with this msg and
a complete explanation.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Remove data from column

Insert a UserForm to your VBA Project. Put a ComboBox and a
CommandButton on the UserForm.
Add the following code to the UserForm:

Private mRng As Range
Private Sub CommandButton1_Click()
mRng(ComboBox1.ListIndex + 1).Delete
ComboBox1.ListIndex = -1
ComboBox1.Clear
UserForm_Initialize
End Sub

Private Sub UserForm_Initialize()
Set mRng = Sheets("Cat Picklist").Range(Cells(2, "a"), Cells(2,
"a").End(xlDown))
For Each c In mRng
ComboBox1.AddItem c
Next c
End Sub

Add the following to the module with Sub NewCategory:

Sub DeleteCategory()
UserForm1.Show
End Sub

Hope that helps.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove a column but not data table entry ClaireP Charts and Charting in Excel 4 October 9th 09 06:32 AM
Stacked column, remove label if data is zero Mr.LuckyMe Charts and Charting in Excel 3 October 23rd 08 07:48 PM
Find and remove data from a column jlclyde Excel Discussion (Misc queries) 3 May 21st 08 09:35 AM
Scan and remove column data query IE Excel Worksheet Functions 5 March 23rd 07 09:50 AM
how do i remove a portion of data from a column SynAtl Excel Discussion (Misc queries) 2 March 15th 07 06:42 PM


All times are GMT +1. The time now is 05:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"