LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Selecting Cells to enter information

You pointed me in the right direction. After some modification here is the
final outcome. <I really need to get my boss to allow me training in code

Sub Formatting()
Dim c As Variant
Columns("K:K").Select
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False,
FieldInfo _
:=Array(1, 2), TrailingMinusNumbers:=True
Range("A1").Select
Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

Set c = ActiveCell
Cells(c.Row, 2) = "N/A"
Cells(c.Row, 3) = 41
Cells(c.Row, 5) = "N/A"
Cells(c.Row, 11) = "N/A"
Cells(c.Row + 1, 1).Select
Set c = ActiveCell
Cells(c.Row, 2) = "N/A"
Cells(c.Row, 3) = 42
Cells(c.Row, 5) = "N/A"
Cells(c.Row, 11) = "N/A"
Cells(c.Row + 1, 1).Select
Set c = ActiveCell
Cells(c.Row, 2) = "N/A"
Cells(c.Row, 3) = 43
Cells(c.Row, 5) = "N/A"
Cells(c.Row, 11) = "N/A"
Cells(c.Row + 1, 1).Select
Set c = Nothing
ActiveWorkbook.Save

End Sub


I had a problem with the code line:

Set c = Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

For some reason it would not take, hence the change to Set c= ActiveCell.
It works now and that is what matters. Thanks.
--
Thank you for your time.
Windows XP
Office 2002


"Martin Fishlock" wrote:

James:

You need something like the following, but there is a problem with stopping
it.
You need a stopper in the find.


Sub Formatting()
Dim c As Variant
Columns("K:K").Select
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, _
FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True
Selection.TextToColumns Destination:=Range("K1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, _
FieldInfo:=Array(1, 2), TrailingMinusNumbers:=True
Range("A1").Select
Set c = Cells.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas,
LookAt:= _
xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
Do While TypeName(c) = "Range"
Cells(c.Row, 2) = "N/A"
Cells(c.Row, 3) = 41
Cells(c.Row, 5) = "N/A"
Cells(c.Row, 11) = "N/A"
Cells(c.Row + 1, 1).Select
If c.Row = 65535 Then Exit Do
Set c = Cells.FindNext(ActiveCell).Select
' need a stopper in here for the end of the values try:
Loop
Set c = Nothing
ActiveWorkbook.Save

End Sub

--
HTHs Martin



 
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
what type of information we can enter into spreadsheet cells? Nina New Users to Excel 1 April 27th 09 10:39 AM
boxes with information to enter widman Excel Discussion (Misc queries) 4 December 10th 06 01:08 AM
How do I make someone enter information in a cell Vicky T Excel Discussion (Misc queries) 1 June 7th 06 05:45 PM
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? Marc New Users to Excel 1 March 10th 06 05:10 PM
selecting current row information and transfering it. Alan M Excel Programming 3 December 15th 04 03:16 AM


All times are GMT +1. The time now is 11:47 PM.

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"