Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Change to Current Cell

I have recorded a macro using the record Macro feature in Excel I would like
to know how I can change the following code to reflect the current cell
which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Change to Current Cell

Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Change to Current Cell


I suggest posting all of your code for comments.

--
Don Guillett
SalesAid Software

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Change to Current Cell

I can do that.

Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\s cratch\CD000.txt", _
Destination:=Range("B689"))
.Name = "CD000_34"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "~"
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub


--

Regards
Michael Koerner


"Don Guillett" wrote in message
...

I suggest posting all of your code for comments.

--
Don Guillett
SalesAid Software

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Change to Current Cell

Thanks Doug, will try it out

--

Regards
Michael Koerner


"Doug Glancy" wrote in message
...
Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Change to Current Cell

Could not get your suggestion to work.

--

Regards
Michael Koerner


"Michael Koerner" wrote in message
...
Thanks Doug, will try it out

--

Regards
Michael Koerner


"Doug Glancy" wrote in message
...
Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner









  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Change to Current Cell

You may want to give a little more information--and maybe the code you tried and
what you wanted it to do.

Michael Koerner wrote:

Could not get your suggestion to work.

--

Regards
Michael Koerner

"Michael Koerner" wrote in message
...
Thanks Doug, will try it out

--

Regards
Michael Koerner


"Doug Glancy" wrote in message
...
Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner








--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Change to Current Cell

Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\s cratch\CD000.txt", _
Destination:=ActiveCell)
.Name = "CD000_34"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "~"
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub

You need the last paren on that line.

--
Regards,
Tom Ogilvy

"Michael Koerner" wrote in message
...
Could not get your suggestion to work.

--

Regards
Michael Koerner


"Michael Koerner" wrote in message
...
Thanks Doug, will try it out

--

Regards
Michael Koerner


"Doug Glancy" wrote in message
...
Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner











  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Change to Current Cell

Use Tom's suggestion. However, what happens the next time you update and the
active cell is in another location? You may want to delete rows/columns???

--
Don Guillett
SalesAid Software

"Michael Koerner" wrote in message
...
I can do that.

Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\s cratch\CD000.txt", _
Destination:=Range("B689"))
.Name = "CD000_34"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "~"
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub


--

Regards
Michael Koerner


"Don Guillett" wrote in message
...

I suggest posting all of your code for comments.

--
Don Guillett
SalesAid Software

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner









  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Change to Current Cell

Thanks Tom, that did the trick

--

Regards
Michael Koerner


"Tom Ogilvy" wrote in message
...
Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\s cratch\CD000.txt", _
Destination:=ActiveCell)
.Name = "CD000_34"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "~"
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub

You need the last paren on that line.

--
Regards,
Tom Ogilvy

"Michael Koerner" wrote in message
...
Could not get your suggestion to work.

--

Regards
Michael Koerner


"Michael Koerner" wrote in message
...
Thanks Doug, will try it out

--

Regards
Michael Koerner


"Doug Glancy" wrote in message
...
Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner















  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 164
Default Change to Current Cell

Before I run the macro, the cursor is in the correct empty cell

--

Regards
Michael Koerner


"Don Guillett" wrote in message
...
Use Tom's suggestion. However, what happens the next time you update and
the active cell is in another location? You may want to delete
rows/columns???

--
Don Guillett
SalesAid Software

"Michael Koerner" wrote in message
...
I can do that.

Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\s cratch\CD000.txt", _
Destination:=Range("B689"))
.Name = "CD000_34"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileOtherDelimiter = "~"
.TextFileColumnDataTypes = Array(1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub


--

Regards
Michael Koerner


"Don Guillett" wrote in message
...

I suggest posting all of your code for comments.

--
Don Guillett
SalesAid Software

"Michael Koerner" wrote in message
...
I have recorded a macro using the record Macro feature in Excel I would
like to know how I can change the following code to reflect the current
cell which the cursor is in.

Destination:=Range("B689"))

--

Regards
Michael Koerner











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
How do a set the current date to change in cell everyday trip_to_tokyo[_3_] Excel Discussion (Misc queries) 0 October 15th 09 04:48 PM
formula to change current cell value Robert H Excel Worksheet Functions 2 February 20th 07 07:39 AM
Change Validation list in the adjecent cell on the Basis of Value in the Current Cell ankur Excel Programming 1 January 10th 07 12:56 AM
change current cell colour based on the value of adjacent cell on other worksheet Rits Excel Programming 2 November 23rd 06 11:57 AM
How to set current day when a cell in a colum change Steen Excel Discussion (Misc queries) 2 October 16th 06 12:29 PM


All times are GMT +1. The time now is 11:12 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"