LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Update a range within a macro using an input box or similar

I am really new to VBA. I am building a tool that extracts random records
using the row numbers in Excel. The random numbers are generated by an
outside source and come in the format '123, 456, 789'

I've created a code that exctracts rows 123, 456, 789.

'///////////CODE BEGINS HERE/////////////
Range("A123,A456,A789").EntireRow.Copy
Sheets("Sample").Select
ActiveSheet.Range("A1").Select
ActiveCell.PasteSpecial (xlPasteValuesAndNumberFormats)
Application.CutCopyMode = False
End Sub
'//////////CODE ENDS HERE//////////////////

To get to this point requires a lot of massaging of the numbers in VBA
(adding the 'A' and removing the spaces) usually using global search and
replace. This is simple enough for me, but not simple enough for some end
users.

I want to use an input box or other pop-up type tool imbedded in the macro
that allows the user to input the numbers as a group (copy and paste in one
step) in the format supplied to them (e.g. '123, 456, 789') that will
automatically convert them to the correct format (e.g. 'A123,A456,A789') and
then update the RANGE line of the macro built above before the macro
continues past this point.

Any help will be appreciated.

Thanks,

 
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
Drop Down--How do I copy and update cell link/input range MaryinCT Excel Discussion (Misc queries) 1 November 2nd 07 01:13 AM
Combo Box input range automatic update John M Excel Discussion (Misc queries) 1 May 11th 06 08:05 PM
Macro to update pivot table data range Mike_M Excel Programming 2 May 25th 05 04:02 PM
Macro to change list box input range based on selection made in another cell Sue[_6_] Excel Programming 3 October 7th 04 06:45 PM
Macro to input formula in range based on another range Peter Atherton Excel Programming 0 October 9th 03 12:47 AM


All times are GMT +1. The time now is 04:42 AM.

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

About Us

"It's about Microsoft Excel"