PC Review


Reply
Thread Tools Rate Thread

Change to Current Cell

 
 
Michael Koerner
Guest
Posts: n/a
 
      27th Jan 2007
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 With Quote
 
 
 
 
Doug Glancy
Guest
Posts: n/a
 
      27th Jan 2007
Michael,

Destination:=Activecell

hth,

Doug

"Michael Koerner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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 With Quote
 
Don Guillett
Guest
Posts: n/a
 
      27th Jan 2007

I suggest posting all of your code for comments.

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Michael Koerner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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 With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      27th Jan 2007
I can do that.

Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\scratch\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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>
> I suggest posting all of your code for comments.
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Michael Koerner" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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 With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      27th Jan 2007
Thanks Doug, will try it out

--

Regards
Michael Koerner


"Doug Glancy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Michael,
>
> Destination:=Activecell
>
> hth,
>
> Doug
>
> "Michael Koerner" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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 With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      28th Jan 2007
Could not get your suggestion to work.

--

Regards
Michael Koerner


"Michael Koerner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Doug, will try it out
>
> --
>
> Regards
> Michael Koerner
>
>
> "Doug Glancy" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Michael,
>>
>> Destination:=Activecell
>>
>> hth,
>>
>> Doug
>>
>> "Michael Koerner" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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 With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      28th Jan 2007
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks Doug, will try it out
> >
> > --
> >
> > Regards
> > Michael Koerner
> >
> >
> > "Doug Glancy" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> Michael,
> >>
> >> Destination:=Activecell
> >>
> >> hth,
> >>
> >> Doug
> >>
> >> "Michael Koerner" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >>>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
 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      28th Jan 2007
Sub UpdateList()

With
ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\scratch\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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Could not get your suggestion to work.
>
> --
>
> Regards
> Michael Koerner
>
>
> "Michael Koerner" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Thanks Doug, will try it out
>>
>> --
>>
>> Regards
>> Michael Koerner
>>
>>
>> "Doug Glancy" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Michael,
>>>
>>> Destination:=Activecell
>>>
>>> hth,
>>>
>>> Doug
>>>
>>> "Michael Koerner" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>>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 With Quote
 
Don Guillett
Guest
Posts: n/a
 
      28th Jan 2007
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
(E-Mail Removed)
"Michael Koerner" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I can do that.
>
> Sub UpdateList()
>
> With
> ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\scratch\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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>>
>> I suggest posting all of your code for comments.
>>
>> --
>> Don Guillett
>> SalesAid Software
>> (E-Mail Removed)
>> "Michael Koerner" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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 With Quote
 
Michael Koerner
Guest
Posts: n/a
 
      28th Jan 2007
Thanks Tom, that did the trick

--

Regards
Michael Koerner


"Tom Ogilvy" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Sub UpdateList()
>
> With
> ActiveSheet.QueryTables.Add(Connection:="TEXT;C:\scratch\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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Could not get your suggestion to work.
>>
>> --
>>
>> Regards
>> Michael Koerner
>>
>>
>> "Michael Koerner" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Thanks Doug, will try it out
>>>
>>> --
>>>
>>> Regards
>>> Michael Koerner
>>>
>>>
>>> "Doug Glancy" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Michael,
>>>>
>>>> Destination:=Activecell
>>>>
>>>> hth,
>>>>
>>>> Doug
>>>>
>>>> "Michael Koerner" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>>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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change another cell's contents from current cell??? =?Utf-8?B?SGFuZHNvbWVKYWtl?= Microsoft Excel Misc 1 12th Mar 2007 12:42 AM
formula to change current cell value Robert H Microsoft Excel Worksheet Functions 2 20th Feb 2007 07:39 AM
Change Validation list in the adjecent cell on the Basis of Value in the Current Cell ankur Microsoft Excel Programming 1 10th Jan 2007 12:56 AM
change current cell colour based on the value of adjacent cell on other worksheet Rits Microsoft Excel Programming 2 23rd Nov 2006 11:57 AM
How to set current day when a cell in a colum change =?Utf-8?B?U3RlZW4=?= Microsoft Excel Misc 2 16th Oct 2006 12:29 PM


Features
 

Advertising
 

Newsgroups
 


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